├── .gitignore ├── CMakeLists.txt ├── Doxyfile ├── LICENSE ├── cmake ├── CheckFortranSourceCompiles.cmake ├── CheckFortranSourceRuns.cmake ├── DepsLibTensor.txt ├── DepsLibUtil.txt ├── FindACML.cmake ├── FindATLAS.cmake ├── FindCBLAS.cmake ├── FindCTF.cmake ├── FindESSL.cmake ├── FindGSL.cmake ├── FindLAPACK.cmake ├── FindMKL.cmake ├── FindOpenBLAS.cmake ├── SetupLibTensor.txt ├── SetupLibUtil.txt └── SetupMKL.txt ├── configure ├── libtensor ├── CMakeLists.txt ├── arma │ ├── btod_export_arma.h │ └── impl │ │ ├── btod_export_arma.C │ │ └── btod_export_arma_impl.h ├── block_sparse │ ├── batch_kernel.h │ ├── batch_kernel_add2.h │ ├── batch_kernel_contract2.h │ ├── batch_kernel_permute.h │ ├── batch_kernel_reblock.h │ ├── batch_kernel_unblock.h │ ├── batch_list_builder.C │ ├── batch_list_builder.h │ ├── batch_provider.h │ ├── blas_isomorphism.h │ ├── block_add2_kernel.h │ ├── block_contract2_kernel.h │ ├── block_kernel_i.h │ ├── block_load_kernel.h │ ├── block_loop.C │ ├── block_loop.h │ ├── block_permute_kernel.h │ ├── block_print_kernel.h │ ├── connectivity.C │ ├── connectivity.h │ ├── direct_sparse_btensor.h │ ├── gen_labeled_btensor.h │ ├── gen_sparse_btensor.h │ ├── memory_reserve.C │ ├── memory_reserve.h │ ├── range.C │ ├── range.h │ ├── runtime_permutation.h │ ├── sparse_bispace.h │ ├── sparse_bispace_impl.C │ ├── sparse_bispace_impl.h │ ├── sparse_btensor.h │ ├── sparse_defs.h │ ├── sparse_loop_grouper.C │ ├── sparse_loop_grouper.h │ ├── sparse_loop_list.C │ ├── sparse_loop_list.h │ ├── sparsity_data.C │ ├── sparsity_data.h │ ├── sparsity_expr.h │ ├── sparsity_fuser.C │ ├── sparsity_fuser.h │ ├── subspace.C │ ├── subspace.h │ ├── subspace_iterator.C │ └── subspace_iterator.h ├── block_tensor │ ├── block_factory.h │ ├── block_tensor.h │ ├── block_tensor_ctrl.h │ ├── block_tensor_i.h │ ├── block_tensor_i_traits.h │ ├── block_tensor_traits.h │ ├── btod.h │ ├── btod_add.h │ ├── btod_apply.h │ ├── btod_compare.h │ ├── btod_contract2.h │ ├── btod_contract2_clst_optimize.h │ ├── btod_contract2_xm.h │ ├── btod_contract3.h │ ├── btod_copy.h │ ├── btod_copy_xm.h │ ├── btod_diag.h │ ├── btod_dirsum.h │ ├── btod_dotprod.h │ ├── btod_ewmult2.h │ ├── btod_export.h │ ├── btod_extract.h │ ├── btod_mult.h │ ├── btod_mult1.h │ ├── btod_random.h │ ├── btod_scale.h │ ├── btod_select.h │ ├── btod_set.h │ ├── btod_set_diag.h │ ├── btod_set_elem.h │ ├── btod_shift_diag.h │ ├── btod_sum.h │ ├── btod_symcontract3.h │ ├── btod_symmetrize2.h │ ├── btod_symmetrize3.h │ ├── btod_symmetrize4.h │ ├── btod_trace.h │ ├── btod_traits.h │ ├── btod_vmpriority.h │ ├── direct_block_tensor.h │ └── impl │ │ ├── block_tensor.C │ │ ├── btod_add.C │ │ ├── btod_add_impl.h │ │ ├── btod_addition_schedule.C │ │ ├── btod_apply_impl.h │ │ ├── btod_aux_add.C │ │ ├── btod_aux_chsym.C │ │ ├── btod_aux_copy.C │ │ ├── btod_aux_symmetrize.C │ │ ├── btod_aux_transform.C │ │ ├── btod_compare.C │ │ ├── btod_compare_impl.h │ │ ├── btod_contract2_1.C │ │ ├── btod_contract2_1_xm.C │ │ ├── btod_contract2_2.C │ │ ├── btod_contract2_2_xm.C │ │ ├── btod_contract2_3.C │ │ ├── btod_contract2_3_xm.C │ │ ├── btod_contract2_4.C │ │ ├── btod_contract2_4_xm.C │ │ ├── btod_contract2_5.C │ │ ├── btod_contract2_5_xm.C │ │ ├── btod_contract2_6.C │ │ ├── btod_contract2_6_xm.C │ │ ├── btod_contract2_7.C │ │ ├── btod_contract2_7_xm.C │ │ ├── btod_contract2_8.C │ │ ├── btod_contract2_8_xm.C │ │ ├── btod_contract2_clst_builder.C │ │ ├── btod_contract2_clst_optimize.C │ │ ├── btod_contract2_clst_optimize_impl.h │ │ ├── btod_contract2_impl.h │ │ ├── btod_contract2_nzorb.C │ │ ├── btod_contract2_xm_impl.h │ │ ├── btod_contract3.C │ │ ├── btod_contract3_impl.h │ │ ├── btod_copy.C │ │ ├── btod_copy_impl.h │ │ ├── btod_copy_xm.C │ │ ├── btod_copy_xm_impl.h │ │ ├── btod_diag.C │ │ ├── btod_diag_impl.h │ │ ├── btod_dirsum.C │ │ ├── btod_dirsum_impl.h │ │ ├── btod_dotprod.C │ │ ├── btod_dotprod_impl.h │ │ ├── btod_ewmult2.C │ │ ├── btod_ewmult2_impl.h │ │ ├── btod_export.C │ │ ├── btod_export_impl.h │ │ ├── btod_extract.C │ │ ├── btod_extract_impl.h │ │ ├── btod_mult.C │ │ ├── btod_mult1.C │ │ ├── btod_mult1_impl.h │ │ ├── btod_mult_impl.h │ │ ├── btod_random.C │ │ ├── btod_random_impl.h │ │ ├── btod_scale.C │ │ ├── btod_scale_impl.h │ │ ├── btod_select_impl.h │ │ ├── btod_set.C │ │ ├── btod_set_diag.C │ │ ├── btod_set_diag_impl.h │ │ ├── btod_set_elem.C │ │ ├── btod_set_elem_impl.h │ │ ├── btod_set_impl.h │ │ ├── btod_shift_diag.C │ │ ├── btod_shift_diag_impl.h │ │ ├── btod_size.C │ │ ├── btod_sum.C │ │ ├── btod_sum_impl.h │ │ ├── btod_symcontract3.C │ │ ├── btod_symcontract3_impl.h │ │ ├── btod_symmetrize2.C │ │ ├── btod_symmetrize2_impl.h │ │ ├── btod_symmetrize3.C │ │ ├── btod_symmetrize3_impl.h │ │ ├── btod_symmetrize4.C │ │ ├── btod_symmetrize4_impl.h │ │ ├── btod_trace.C │ │ ├── btod_unfold_block_list.C │ │ ├── btod_unfold_symmetry.C │ │ └── btod_vmpriority.C ├── btod │ ├── btod_diagonalize.C │ ├── btod_diagonalize.h │ ├── btod_import_raw.h │ ├── btod_import_raw_base.h │ ├── btod_import_raw_stream.h │ ├── btod_print.h │ ├── btod_read.h │ ├── btod_tridiagonalize.C │ └── btod_tridiagonalize.h ├── core │ ├── abs_index.h │ ├── allocator.h │ ├── allocator_init.h │ ├── bad_block_index_space.h │ ├── bad_dimensions.h │ ├── batching_policy_base.h │ ├── block_index_space.h │ ├── block_index_space_product_builder.h │ ├── block_index_subspace_builder.h │ ├── block_tensor_element.h │ ├── combined_orbits.h │ ├── contraction2.h │ ├── contraction2_align.h │ ├── contraction2_list_builder.h │ ├── dimensions.h │ ├── immutable.h │ ├── impl │ │ ├── abs_index.C │ │ ├── abs_index_impl.h │ │ ├── allocator.C │ │ ├── allocator_impl.h │ │ ├── allocator_wrapper.h │ │ ├── batching_policy_base.C │ │ ├── combined_orbits.C │ │ ├── combined_orbits_impl.h │ │ ├── dimensions.C │ │ ├── dimensions_impl.h │ │ ├── libdivide.h │ │ ├── magic_dimensions.C │ │ ├── magic_dimensions_impl.h │ │ ├── orbit.C │ │ ├── orbit_impl.h │ │ ├── orbit_list.C │ │ ├── orbit_list_impl.h │ │ ├── short_orbit.C │ │ ├── short_orbit_impl.h │ │ ├── std_allocator.h │ │ ├── subgroup_orbits.C │ │ ├── subgroup_orbits_impl.h │ │ ├── vm_allocator.h │ │ └── xm_allocator.h │ ├── index.h │ ├── index_range.h │ ├── magic_dimensions.h │ ├── mask.h │ ├── noncopyable.h │ ├── orbit.h │ ├── orbit_list.h │ ├── out_of_bounds.h │ ├── permutation.h │ ├── permutation_builder.h │ ├── permutation_generator.h │ ├── print_dimensions.h │ ├── scalar_transf.h │ ├── scalar_transf_double.h │ ├── sequence.h │ ├── sequence_generator.h │ ├── short_orbit.h │ ├── split_points.h │ ├── subgroup_orbits.h │ ├── symmetry.h │ ├── symmetry_element_i.h │ ├── symmetry_element_set.h │ ├── tensor_element.h │ ├── tensor_transf.h │ ├── tensor_transf_double.h │ └── transf_list.h ├── ctf_block_tensor │ ├── ctf_block_tensor.h │ ├── ctf_block_tensor_i.h │ ├── ctf_block_tensor_i_traits.h │ ├── ctf_block_tensor_traits.h │ ├── ctf_btod_collect.h │ ├── ctf_btod_contract2.h │ ├── ctf_btod_copy.h │ ├── ctf_btod_diag.h │ ├── ctf_btod_dirsum.h │ ├── ctf_btod_distribute.h │ ├── ctf_btod_dotprod.h │ ├── ctf_btod_ewmult2.h │ ├── ctf_btod_mult.h │ ├── ctf_btod_mult1.h │ ├── ctf_btod_random.h │ ├── ctf_btod_scale.h │ ├── ctf_btod_set.h │ ├── ctf_btod_set_diag.h │ ├── ctf_btod_shift_diag.h │ ├── ctf_btod_sum.h │ ├── ctf_btod_symmetrize2.h │ ├── ctf_btod_symmetrize3.h │ ├── ctf_btod_trace.h │ ├── ctf_btod_traits.h │ ├── ctf_symmetry_builder.h │ └── impl │ │ ├── ctf_block_tensor.C │ │ ├── ctf_btod_addition_schedule.C │ │ ├── ctf_btod_aux_add.C │ │ ├── ctf_btod_aux_chsym.C │ │ ├── ctf_btod_aux_copy.C │ │ ├── ctf_btod_aux_symmetrize.C │ │ ├── ctf_btod_aux_transform.C │ │ ├── ctf_btod_collect.C │ │ ├── ctf_btod_collect_impl.h │ │ ├── ctf_btod_contract2_1.C │ │ ├── ctf_btod_contract2_2.C │ │ ├── ctf_btod_contract2_3.C │ │ ├── ctf_btod_contract2_4.C │ │ ├── ctf_btod_contract2_5.C │ │ ├── ctf_btod_contract2_6.C │ │ ├── ctf_btod_contract2_7.C │ │ ├── ctf_btod_contract2_8.C │ │ ├── ctf_btod_contract2_clst_builder.C │ │ ├── ctf_btod_contract2_impl.h │ │ ├── ctf_btod_contract2_nzorb.C │ │ ├── ctf_btod_copy.C │ │ ├── ctf_btod_copy_impl.h │ │ ├── ctf_btod_diag.C │ │ ├── ctf_btod_diag_impl.h │ │ ├── ctf_btod_dirsum.C │ │ ├── ctf_btod_dirsum_impl.h │ │ ├── ctf_btod_distribute.C │ │ ├── ctf_btod_distribute_impl.h │ │ ├── ctf_btod_dotprod.C │ │ ├── ctf_btod_dotprod_impl.h │ │ ├── ctf_btod_ewmult2.C │ │ ├── ctf_btod_ewmult2_impl.h │ │ ├── ctf_btod_mult.C │ │ ├── ctf_btod_mult1.C │ │ ├── ctf_btod_mult1_impl.h │ │ ├── ctf_btod_mult_impl.h │ │ ├── ctf_btod_random.C │ │ ├── ctf_btod_random_impl.h │ │ ├── ctf_btod_scale.C │ │ ├── ctf_btod_scale_impl.h │ │ ├── ctf_btod_set.C │ │ ├── ctf_btod_set_diag.C │ │ ├── ctf_btod_set_diag_impl.h │ │ ├── ctf_btod_set_impl.h │ │ ├── ctf_btod_set_symmetry.C │ │ ├── ctf_btod_set_symmetry.h │ │ ├── ctf_btod_set_symmetry_impl.h │ │ ├── ctf_btod_shift_diag.C │ │ ├── ctf_btod_shift_diag_impl.h │ │ ├── ctf_btod_sum.C │ │ ├── ctf_btod_sum_impl.h │ │ ├── ctf_btod_symmetrize2.C │ │ ├── ctf_btod_symmetrize2_impl.h │ │ ├── ctf_btod_symmetrize3.C │ │ ├── ctf_btod_symmetrize3_impl.h │ │ ├── ctf_btod_trace.C │ │ ├── ctf_btod_trace_impl.h │ │ ├── ctf_btod_unfold_block_list.C │ │ ├── ctf_symmetry_builder.C │ │ └── ctf_symmetry_builder_impl.h ├── ctf_btensor.h ├── ctf_dense_tensor │ ├── ctf.h │ ├── ctf_dense_tensor.h │ ├── ctf_dense_tensor_ctrl.h │ ├── ctf_dense_tensor_i.h │ ├── ctf_error.h │ ├── ctf_symmetry.h │ ├── ctf_tod_collect.h │ ├── ctf_tod_contract2.h │ ├── ctf_tod_contract2_streamed.h │ ├── ctf_tod_copy.h │ ├── ctf_tod_diag.h │ ├── ctf_tod_dirsum.h │ ├── ctf_tod_distribute.h │ ├── ctf_tod_dotprod.h │ ├── ctf_tod_ewmult2.h │ ├── ctf_tod_mult.h │ ├── ctf_tod_mult1.h │ ├── ctf_tod_random.h │ ├── ctf_tod_scale.h │ ├── ctf_tod_scatter.h │ ├── ctf_tod_set.h │ ├── ctf_tod_set_diag.h │ ├── ctf_tod_set_symmetry.h │ ├── ctf_tod_trace.h │ └── impl │ │ ├── ctf.C │ │ ├── ctf_dense_tensor.C │ │ ├── ctf_dense_tensor_impl.h │ │ ├── ctf_fctr.C │ │ ├── ctf_fctr.h │ │ ├── ctf_symmetry.C │ │ ├── ctf_symmetry_impl.h │ │ ├── ctf_tod_aux_symcomp.h │ │ ├── ctf_tod_collect.C │ │ ├── ctf_tod_collect_impl.h │ │ ├── ctf_tod_contract2_1.C │ │ ├── ctf_tod_contract2_2.C │ │ ├── ctf_tod_contract2_3.C │ │ ├── ctf_tod_contract2_4.C │ │ ├── ctf_tod_contract2_5.C │ │ ├── ctf_tod_contract2_6.C │ │ ├── ctf_tod_contract2_7.C │ │ ├── ctf_tod_contract2_8.C │ │ ├── ctf_tod_contract2_impl.h │ │ ├── ctf_tod_contract2_streamed_1.C │ │ ├── ctf_tod_contract2_streamed_2.C │ │ ├── ctf_tod_contract2_streamed_3.C │ │ ├── ctf_tod_contract2_streamed_4.C │ │ ├── ctf_tod_contract2_streamed_5.C │ │ ├── ctf_tod_contract2_streamed_6.C │ │ ├── ctf_tod_contract2_streamed_7.C │ │ ├── ctf_tod_contract2_streamed_8.C │ │ ├── ctf_tod_contract2_streamed_impl.h │ │ ├── ctf_tod_copy.C │ │ ├── ctf_tod_copy_impl.h │ │ ├── ctf_tod_diag.C │ │ ├── ctf_tod_diag_impl.h │ │ ├── ctf_tod_dirsum.C │ │ ├── ctf_tod_dirsum_impl.h │ │ ├── ctf_tod_distribute.C │ │ ├── ctf_tod_distribute_impl.h │ │ ├── ctf_tod_dotprod.C │ │ ├── ctf_tod_dotprod_impl.h │ │ ├── ctf_tod_ewmult2.C │ │ ├── ctf_tod_ewmult2_impl.h │ │ ├── ctf_tod_mult.C │ │ ├── ctf_tod_mult1.C │ │ ├── ctf_tod_mult1_impl.h │ │ ├── ctf_tod_mult_impl.h │ │ ├── ctf_tod_random.C │ │ ├── ctf_tod_random_impl.h │ │ ├── ctf_tod_scale.C │ │ ├── ctf_tod_scale_impl.h │ │ ├── ctf_tod_scatter.C │ │ ├── ctf_tod_scatter_impl.h │ │ ├── ctf_tod_set.C │ │ ├── ctf_tod_set_diag.C │ │ ├── ctf_tod_set_diag_impl.h │ │ ├── ctf_tod_set_impl.h │ │ ├── ctf_tod_set_symmetry.C │ │ ├── ctf_tod_set_symmetry_impl.h │ │ ├── ctf_tod_trace.C │ │ ├── ctf_tod_trace_impl.h │ │ └── ctf_world.h ├── defs.C ├── defs.h ├── dense_tensor │ ├── dense_tensor.h │ ├── dense_tensor_ctrl.h │ ├── dense_tensor_i.h │ ├── impl │ │ ├── dense_tensor.C │ │ ├── dense_tensor_impl.h │ │ ├── to_contract2_dims.C │ │ ├── to_contract2_dims_impl.h │ │ ├── to_diag_dims.C │ │ ├── to_diag_dims_impl.h │ │ ├── to_dirsum_dims.C │ │ ├── to_dirsum_dims_impl.h │ │ ├── to_ewmult2_dims.C │ │ ├── to_ewmult2_dims_impl.h │ │ ├── tod_add.C │ │ ├── tod_add_impl.h │ │ ├── tod_apply_impl.h │ │ ├── tod_btconv.C │ │ ├── tod_btconv_impl.h │ │ ├── tod_compare.C │ │ ├── tod_compare_impl.h │ │ ├── tod_contract2_1.C │ │ ├── tod_contract2_2.C │ │ ├── tod_contract2_3.C │ │ ├── tod_contract2_4.C │ │ ├── tod_contract2_5.C │ │ ├── tod_contract2_6.C │ │ ├── tod_contract2_7.C │ │ ├── tod_contract2_8.C │ │ ├── tod_contract2_impl.h │ │ ├── tod_copy.C │ │ ├── tod_copy_impl.h │ │ ├── tod_copy_wnd.C │ │ ├── tod_copy_wnd_impl.h │ │ ├── tod_diag.C │ │ ├── tod_diag_impl.h │ │ ├── tod_dirsum.C │ │ ├── tod_dirsum_impl.h │ │ ├── tod_dotprod.C │ │ ├── tod_dotprod_impl.h │ │ ├── tod_ewmult2.C │ │ ├── tod_ewmult2_impl.h │ │ ├── tod_extract.C │ │ ├── tod_extract_impl.h │ │ ├── tod_import_raw.C │ │ ├── tod_import_raw_impl.h │ │ ├── tod_import_raw_stream.C │ │ ├── tod_import_raw_stream_impl.h │ │ ├── tod_mult.C │ │ ├── tod_mult1.C │ │ ├── tod_mult1_impl.h │ │ ├── tod_mult_impl.h │ │ ├── tod_random.C │ │ ├── tod_random_impl.h │ │ ├── tod_scale.C │ │ ├── tod_scale_impl.h │ │ ├── tod_scatter.C │ │ ├── tod_scatter_impl.h │ │ ├── tod_screen.C │ │ ├── tod_screen_impl.h │ │ ├── tod_select_impl.h │ │ ├── tod_set.C │ │ ├── tod_set_diag.C │ │ ├── tod_set_diag_impl.h │ │ ├── tod_set_elem.C │ │ ├── tod_set_elem_impl.h │ │ ├── tod_set_impl.h │ │ ├── tod_size.C │ │ ├── tod_size_impl.h │ │ ├── tod_trace.C │ │ ├── tod_trace_impl.h │ │ ├── tod_vmpriority.C │ │ └── tod_vmpriority_impl.h │ ├── to_contract2_dims.h │ ├── to_diag_dims.h │ ├── to_dirsum_dims.h │ ├── to_ewmult2_dims.h │ ├── tod.h │ ├── tod_add.h │ ├── tod_apply.h │ ├── tod_btconv.h │ ├── tod_compare.h │ ├── tod_contract2.h │ ├── tod_copy.h │ ├── tod_copy_wnd.h │ ├── tod_diag.h │ ├── tod_dirsum.h │ ├── tod_dotprod.h │ ├── tod_ewmult2.h │ ├── tod_extract.h │ ├── tod_import_raw.h │ ├── tod_import_raw_stream.h │ ├── tod_mult.h │ ├── tod_mult1.h │ ├── tod_random.h │ ├── tod_scale.h │ ├── tod_scatter.h │ ├── tod_screen.h │ ├── tod_select.h │ ├── tod_set.h │ ├── tod_set_diag.h │ ├── tod_set_elem.h │ ├── tod_size.h │ ├── tod_trace.h │ └── tod_vmpriority.h ├── diag_block_tensor │ ├── diag_block_factory.h │ ├── diag_block_tensor.h │ ├── diag_block_tensor_i.h │ ├── diag_block_tensor_i_traits.h │ ├── diag_block_tensor_traits.h │ ├── diag_btod_contract2.h │ ├── diag_btod_copy.h │ ├── diag_btod_dotprod.h │ ├── diag_btod_random.h │ ├── diag_btod_traits.h │ ├── impl │ │ ├── diag_block_tensor.C │ │ ├── diag_btod_addition_schedule.C │ │ ├── diag_btod_aux_add.C │ │ ├── diag_btod_aux_copy.C │ │ ├── diag_btod_contract2.C │ │ ├── diag_btod_contract2_clst_builder.C │ │ ├── diag_btod_contract2_impl.h │ │ ├── diag_btod_copy.C │ │ ├── diag_btod_copy_impl.h │ │ ├── diag_btod_dotprod.C │ │ ├── diag_btod_dotprod_impl.h │ │ ├── diag_btod_random.C │ │ ├── diag_btod_random_impl.h │ │ ├── diag_btod_unfold_block_list.C │ │ ├── tod_conv_diag_block_tensor.C │ │ └── tod_conv_diag_block_tensor_impl.h │ └── tod_conv_diag_block_tensor.h ├── diag_tensor │ ├── diag_tensor.h │ ├── diag_tensor_ctrl.h │ ├── diag_tensor_i.h │ ├── diag_tensor_space.h │ ├── diag_to_add_space.h │ ├── diag_to_contract2_space.h │ ├── diag_tod_adjust_space.h │ ├── diag_tod_contract2.h │ ├── diag_tod_contract2s.h │ ├── diag_tod_copy.h │ ├── diag_tod_dotprod.h │ ├── diag_tod_mult1.h │ ├── diag_tod_random.h │ ├── diag_tod_set.h │ ├── impl │ │ ├── diag_tensor.C │ │ ├── diag_tensor_impl.h │ │ ├── diag_tensor_space.C │ │ ├── diag_tensor_space_impl.h │ │ ├── diag_to_add_space.C │ │ ├── diag_to_add_space_impl.h │ │ ├── diag_to_contract2_space.C │ │ ├── diag_to_contract2_space_impl.h │ │ ├── diag_to_contract2_subspace.h │ │ ├── diag_tod_adjust_space.C │ │ ├── diag_tod_adjust_space_impl.h │ │ ├── diag_tod_aux_constr_add.C │ │ ├── diag_tod_aux_constr_add.h │ │ ├── diag_tod_aux_constr_add_impl.h │ │ ├── diag_tod_aux_constr_base.C │ │ ├── diag_tod_aux_constr_base.h │ │ ├── diag_tod_aux_constr_base_impl.h │ │ ├── diag_tod_aux_dotprod.C │ │ ├── diag_tod_aux_dotprod.h │ │ ├── diag_tod_aux_dotprod_impl.h │ │ ├── diag_tod_contract2.C │ │ ├── diag_tod_contract2_impl.h │ │ ├── diag_tod_contract2_part.h │ │ ├── diag_tod_contract2s.C │ │ ├── diag_tod_contract2s_impl.h │ │ ├── diag_tod_copy.C │ │ ├── diag_tod_copy_impl.h │ │ ├── diag_tod_dotprod.C │ │ ├── diag_tod_dotprod_impl.h │ │ ├── diag_tod_mult1.C │ │ ├── diag_tod_mult1_impl.h │ │ ├── diag_tod_random.C │ │ ├── diag_tod_random_impl.h │ │ ├── diag_tod_set.C │ │ ├── diag_tod_set_impl.h │ │ ├── tod_conv_diag_tensor.C │ │ └── tod_conv_diag_tensor_impl.h │ └── tod_conv_diag_tensor.h ├── exception.C ├── exception.h ├── expr │ ├── bispace │ │ ├── asym.h │ │ ├── bispace.h │ │ ├── bispace_exception.h │ │ ├── expr.h │ │ ├── ident.h │ │ ├── operator_and.h │ │ ├── operator_or.h │ │ └── sym.h │ ├── btensor │ │ ├── btensor.h │ │ ├── btensor_i.h │ │ ├── eval_btensor.h │ │ ├── eval_btensor_double.h │ │ ├── eval_btensor_holder.h │ │ └── impl │ │ │ ├── btensor_placeholder.h │ │ │ ├── eval_btensor_double.C │ │ │ ├── eval_btensor_double_add.C │ │ │ ├── eval_btensor_double_add.h │ │ │ ├── eval_btensor_double_autoselect.C │ │ │ ├── eval_btensor_double_autoselect.h │ │ │ ├── eval_btensor_double_contract.C │ │ │ ├── eval_btensor_double_contract.h │ │ │ ├── eval_btensor_double_copy.C │ │ │ ├── eval_btensor_double_copy.h │ │ │ ├── eval_btensor_double_diag.C │ │ │ ├── eval_btensor_double_diag.h │ │ │ ├── eval_btensor_double_dirsum.C │ │ │ ├── eval_btensor_double_dirsum.h │ │ │ ├── eval_btensor_double_div.C │ │ │ ├── eval_btensor_double_div.h │ │ │ ├── eval_btensor_double_dot_product.C │ │ │ ├── eval_btensor_double_dot_product.h │ │ │ ├── eval_btensor_double_scale.C │ │ │ ├── eval_btensor_double_scale.h │ │ │ ├── eval_btensor_double_set.C │ │ │ ├── eval_btensor_double_set.h │ │ │ ├── eval_btensor_double_symm.C │ │ │ ├── eval_btensor_double_symm.h │ │ │ ├── eval_btensor_double_trace.C │ │ │ ├── eval_btensor_double_trace.h │ │ │ ├── eval_btensor_evaluator_i.h │ │ │ ├── eval_tree_builder_btensor.C │ │ │ ├── eval_tree_builder_btensor.h │ │ │ ├── node_interm.C │ │ │ ├── node_interm.h │ │ │ └── tensor_from_node.h │ ├── common │ │ └── metaprog.h │ ├── ctf_btensor │ │ ├── ctf_btensor.h │ │ ├── ctf_btensor_i.h │ │ ├── eval_ctf_btensor.h │ │ ├── eval_ctf_btensor_double.h │ │ ├── eval_ctf_btensor_holder.h │ │ └── impl │ │ │ ├── ctf_btensor_from_node.h │ │ │ ├── ctf_btensor_placeholder.h │ │ │ ├── eval_ctf_btensor_double.C │ │ │ ├── eval_ctf_btensor_double_add.C │ │ │ ├── eval_ctf_btensor_double_add.h │ │ │ ├── eval_ctf_btensor_double_autoselect.C │ │ │ ├── eval_ctf_btensor_double_autoselect.h │ │ │ ├── eval_ctf_btensor_double_contract.C │ │ │ ├── eval_ctf_btensor_double_contract.h │ │ │ ├── eval_ctf_btensor_double_convert.C │ │ │ ├── eval_ctf_btensor_double_convert.h │ │ │ ├── eval_ctf_btensor_double_copy.C │ │ │ ├── eval_ctf_btensor_double_copy.h │ │ │ ├── eval_ctf_btensor_double_diag.C │ │ │ ├── eval_ctf_btensor_double_diag.h │ │ │ ├── eval_ctf_btensor_double_dirsum.C │ │ │ ├── eval_ctf_btensor_double_dirsum.h │ │ │ ├── eval_ctf_btensor_double_div.C │ │ │ ├── eval_ctf_btensor_double_div.h │ │ │ ├── eval_ctf_btensor_double_dot_product.C │ │ │ ├── eval_ctf_btensor_double_dot_product.h │ │ │ ├── eval_ctf_btensor_double_scale.C │ │ │ ├── eval_ctf_btensor_double_scale.h │ │ │ ├── eval_ctf_btensor_double_set.C │ │ │ ├── eval_ctf_btensor_double_set.h │ │ │ ├── eval_ctf_btensor_double_symm.C │ │ │ ├── eval_ctf_btensor_double_symm.h │ │ │ ├── eval_ctf_btensor_double_trace.C │ │ │ ├── eval_ctf_btensor_double_trace.h │ │ │ ├── eval_ctf_btensor_evaluator_i.h │ │ │ ├── eval_tree_builder_ctf_btensor.C │ │ │ ├── eval_tree_builder_ctf_btensor.h │ │ │ ├── node_ctf_btensor_interm.C │ │ │ └── node_ctf_btensor_interm.h │ ├── dag │ │ ├── expr_tree.C │ │ ├── expr_tree.h │ │ ├── graph.C │ │ ├── graph.h │ │ ├── node.h │ │ ├── node_add.C │ │ ├── node_add.h │ │ ├── node_assign.C │ │ ├── node_assign.h │ │ ├── node_const_scalar.C │ │ ├── node_const_scalar.h │ │ ├── node_contract.C │ │ ├── node_contract.h │ │ ├── node_diag.C │ │ ├── node_diag.h │ │ ├── node_dirsum.C │ │ ├── node_dirsum.h │ │ ├── node_div.C │ │ ├── node_div.h │ │ ├── node_dot_product.C │ │ ├── node_dot_product.h │ │ ├── node_ident.C │ │ ├── node_ident.h │ │ ├── node_null.C │ │ ├── node_null.h │ │ ├── node_product.C │ │ ├── node_product.h │ │ ├── node_reblock.C │ │ ├── node_reblock.h │ │ ├── node_scalar.C │ │ ├── node_scalar.h │ │ ├── node_scale.C │ │ ├── node_scale.h │ │ ├── node_set.C │ │ ├── node_set.h │ │ ├── node_symm.C │ │ ├── node_symm.h │ │ ├── node_trace.C │ │ ├── node_trace.h │ │ ├── node_transform.C │ │ ├── node_transform.h │ │ ├── node_unblock.C │ │ ├── node_unblock.h │ │ ├── print_node.C │ │ ├── print_node.h │ │ ├── print_tree.C │ │ └── print_tree.h │ ├── eval │ │ ├── default_eval_selector.C │ │ ├── default_eval_selector.h │ │ ├── eval.C │ │ ├── eval.h │ │ ├── eval_exception.h │ │ ├── eval_i.h │ │ ├── eval_register.C │ │ ├── eval_register.h │ │ ├── eval_selector_i.h │ │ └── tensor_type_check.h │ ├── expr_exception.h │ ├── iface │ │ ├── any_tensor.h │ │ ├── any_tensor_impl.h │ │ ├── expr_lhs.h │ │ ├── expr_rhs.h │ │ ├── expr_tensor.h │ │ ├── label.h │ │ ├── labeled_lhs_rhs.h │ │ ├── letter.h │ │ └── node_ident_any_tensor.h │ ├── metaprog.h │ ├── operators │ │ ├── contract.h │ │ ├── diag.h │ │ ├── dirsum.h │ │ ├── dot_product.h │ │ ├── ewmult.h │ │ ├── multiply_divide.h │ │ ├── operators.h │ │ ├── plus_minus.h │ │ ├── set.h │ │ ├── symm_asymm.h │ │ └── trace.h │ └── opt │ │ ├── opt_add_before_transf.C │ │ ├── opt_add_before_transf.h │ │ ├── opt_merge_adjacent_add.C │ │ ├── opt_merge_adjacent_add.h │ │ ├── opt_merge_adjacent_transf.C │ │ ├── opt_merge_adjacent_transf.h │ │ ├── opt_merge_equiv_ident.C │ │ └── opt_merge_equiv_ident.h ├── gen_block_tensor │ ├── addition_schedule.h │ ├── additive_gen_bto.h │ ├── assignment_schedule.h │ ├── auto_rwlock.h │ ├── block_map.h │ ├── block_stream_exception.h │ ├── direct_gen_block_tensor.h │ ├── direct_gen_block_tensor_base.h │ ├── direct_gen_bto.h │ ├── gen_block_stream_i.h │ ├── gen_block_tensor.h │ ├── gen_block_tensor_ctrl.h │ ├── gen_block_tensor_i.h │ ├── gen_bto.h │ ├── gen_bto_add.h │ ├── gen_bto_apply.h │ ├── gen_bto_aux_add.h │ ├── gen_bto_aux_chsym.h │ ├── gen_bto_aux_copy.h │ ├── gen_bto_aux_dotprod.h │ ├── gen_bto_aux_symmetrize.h │ ├── gen_bto_aux_transform.h │ ├── gen_bto_compare.h │ ├── gen_bto_contract2.h │ ├── gen_bto_contract2_clst.h │ ├── gen_bto_contract2_simple.h │ ├── gen_bto_contract3.h │ ├── gen_bto_copy.h │ ├── gen_bto_diag.h │ ├── gen_bto_dirsum.h │ ├── gen_bto_dotprod.h │ ├── gen_bto_ewmult2.h │ ├── gen_bto_extract.h │ ├── gen_bto_mult.h │ ├── gen_bto_mult1.h │ ├── gen_bto_random.h │ ├── gen_bto_scale.h │ ├── gen_bto_select.h │ ├── gen_bto_set.h │ ├── gen_bto_set_diag.h │ ├── gen_bto_set_elem.h │ ├── gen_bto_shift_diag.h │ ├── gen_bto_size.h │ ├── gen_bto_sum.h │ ├── gen_bto_symcontract3.h │ ├── gen_bto_symmetrize2.h │ ├── gen_bto_symmetrize3.h │ ├── gen_bto_symmetrize4.h │ ├── gen_bto_trace.h │ ├── gen_bto_vmpriority.h │ └── impl │ │ ├── addition_schedule_impl.h │ │ ├── auto_rwlock.C │ │ ├── block_list.h │ │ ├── block_map_impl.h │ │ ├── direct_gen_block_tensor_impl.h │ │ ├── gen_block_tensor_impl.h │ │ ├── gen_bto_add_impl.h │ │ ├── gen_bto_apply_impl.h │ │ ├── gen_bto_aux_add_impl.h │ │ ├── gen_bto_aux_chsym_impl.h │ │ ├── gen_bto_aux_copy_impl.h │ │ ├── gen_bto_aux_dotprod_impl.h │ │ ├── gen_bto_aux_symmetrize_impl.h │ │ ├── gen_bto_aux_transform_impl.h │ │ ├── gen_bto_compare_impl.h │ │ ├── gen_bto_contract2_batch.h │ │ ├── gen_bto_contract2_batch_impl.h │ │ ├── gen_bto_contract2_batching_policy.h │ │ ├── gen_bto_contract2_bis.C │ │ ├── gen_bto_contract2_bis.h │ │ ├── gen_bto_contract2_bis_impl.h │ │ ├── gen_bto_contract2_block.h │ │ ├── gen_bto_contract2_block_impl.h │ │ ├── gen_bto_contract2_block_list.h │ │ ├── gen_bto_contract2_clst_builder.h │ │ ├── gen_bto_contract2_clst_builder_impl.h │ │ ├── gen_bto_contract2_impl.h │ │ ├── gen_bto_contract2_nzorb.h │ │ ├── gen_bto_contract2_nzorb_impl.h │ │ ├── gen_bto_contract2_simple_impl.h │ │ ├── gen_bto_contract2_sym.h │ │ ├── gen_bto_contract2_sym_impl.h │ │ ├── gen_bto_contract3_batching_policy.h │ │ ├── gen_bto_contract3_impl.h │ │ ├── gen_bto_copy_bis.h │ │ ├── gen_bto_copy_impl.h │ │ ├── gen_bto_copy_nzorb.h │ │ ├── gen_bto_copy_nzorb_impl.h │ │ ├── gen_bto_diag_impl.h │ │ ├── gen_bto_dirsum_impl.h │ │ ├── gen_bto_dirsum_sym.h │ │ ├── gen_bto_dirsum_sym_impl.h │ │ ├── gen_bto_dotprod_impl.h │ │ ├── gen_bto_ewmult2_impl.h │ │ ├── gen_bto_extract_impl.h │ │ ├── gen_bto_mult1_impl.h │ │ ├── gen_bto_mult_impl.h │ │ ├── gen_bto_prefetch.h │ │ ├── gen_bto_random_impl.h │ │ ├── gen_bto_scale_impl.h │ │ ├── gen_bto_select_impl.h │ │ ├── gen_bto_set_diag_impl.h │ │ ├── gen_bto_set_elem_impl.h │ │ ├── gen_bto_set_impl.h │ │ ├── gen_bto_shift_diag_impl.h │ │ ├── gen_bto_size_impl.h │ │ ├── gen_bto_sum_impl.h │ │ ├── gen_bto_symcontract2_sym.h │ │ ├── gen_bto_symcontract2_sym_impl.h │ │ ├── gen_bto_symcontract3_impl.h │ │ ├── gen_bto_symmetrize2_impl.h │ │ ├── gen_bto_symmetrize3_impl.h │ │ ├── gen_bto_symmetrize4_impl.h │ │ ├── gen_bto_trace_impl.h │ │ ├── gen_bto_unfold_block_list.h │ │ ├── gen_bto_unfold_block_list_impl.h │ │ ├── gen_bto_unfold_symmetry.h │ │ ├── gen_bto_unfold_symmetry_impl.h │ │ └── gen_bto_vmpriority_impl.h ├── kernels │ ├── dadd1 │ │ ├── kern_dadd1.C │ │ ├── kern_dadd1_i_i_x.h │ │ ├── kern_dadd1_i_i_x_impl.h │ │ ├── kern_dadd1_ij_ij_x.h │ │ ├── kern_dadd1_ij_ij_x_impl.h │ │ ├── kern_dadd1_ij_ji_x.h │ │ ├── kern_dadd1_ij_ji_x_impl.h │ │ └── kern_dadd1_impl.h │ ├── dadd2 │ │ ├── kern_dadd2.C │ │ ├── kern_dadd2_i_i_x_x.h │ │ ├── kern_dadd2_i_i_x_x_impl.h │ │ ├── kern_dadd2_i_x_i_x.h │ │ ├── kern_dadd2_i_x_i_x_impl.h │ │ └── kern_dadd2_impl.h │ ├── dcopy │ │ ├── kern_dcopy.C │ │ ├── kern_dcopy_i_i_x.h │ │ ├── kern_dcopy_i_i_x_impl.h │ │ ├── kern_dcopy_ij_ij_x.h │ │ ├── kern_dcopy_ij_ij_x_impl.h │ │ ├── kern_dcopy_ij_ji_x.h │ │ ├── kern_dcopy_ij_ji_x_impl.h │ │ └── kern_dcopy_impl.h │ ├── ddiv1 │ │ ├── kern_ddiv1.C │ │ ├── kern_ddiv1_i_i_x.h │ │ ├── kern_ddiv1_i_i_x_impl.h │ │ └── kern_ddiv1_impl.h │ ├── ddiv2 │ │ └── kern_ddiv2.C │ ├── ddivadd1 │ │ └── kern_ddivadd1.C │ ├── dmul1 │ │ └── kern_dmul1.C │ ├── dmul2 │ │ ├── kern_dmul2.C │ │ ├── kern_dmul2_i_i_i.h │ │ ├── kern_dmul2_i_i_i_impl.h │ │ ├── kern_dmul2_i_i_x.h │ │ ├── kern_dmul2_i_i_x_impl.h │ │ ├── kern_dmul2_i_ip_p.h │ │ ├── kern_dmul2_i_ip_p_impl.h │ │ ├── kern_dmul2_i_p_ip.h │ │ ├── kern_dmul2_i_p_ip_impl.h │ │ ├── kern_dmul2_i_p_pi.h │ │ ├── kern_dmul2_i_p_pi_impl.h │ │ ├── kern_dmul2_i_pi_p.h │ │ ├── kern_dmul2_i_pi_p_impl.h │ │ ├── kern_dmul2_i_x_i.h │ │ ├── kern_dmul2_i_x_i_impl.h │ │ ├── kern_dmul2_ij_i_j.h │ │ ├── kern_dmul2_ij_i_j_impl.h │ │ ├── kern_dmul2_ij_ip_jp.h │ │ ├── kern_dmul2_ij_ip_jp_impl.h │ │ ├── kern_dmul2_ij_ip_pj.h │ │ ├── kern_dmul2_ij_ip_pj_impl.h │ │ ├── kern_dmul2_ij_j_i.h │ │ ├── kern_dmul2_ij_j_i_impl.h │ │ ├── kern_dmul2_ij_jp_ip.h │ │ ├── kern_dmul2_ij_jp_ip_impl.h │ │ ├── kern_dmul2_ij_jp_pi.h │ │ ├── kern_dmul2_ij_jp_pi_impl.h │ │ ├── kern_dmul2_ij_pi_jp.h │ │ ├── kern_dmul2_ij_pi_jp_impl.h │ │ ├── kern_dmul2_ij_pi_pj.h │ │ ├── kern_dmul2_ij_pi_pj_impl.h │ │ ├── kern_dmul2_ij_pj_ip.h │ │ ├── kern_dmul2_ij_pj_ip_impl.h │ │ ├── kern_dmul2_ij_pj_pi.h │ │ ├── kern_dmul2_ij_pj_pi_impl.h │ │ ├── kern_dmul2_impl.h │ │ ├── kern_dmul2_x_p_p.h │ │ ├── kern_dmul2_x_p_p_impl.h │ │ ├── kern_dmul2_x_pq_pq.h │ │ ├── kern_dmul2_x_pq_pq_impl.h │ │ ├── kern_dmul2_x_pq_qp.h │ │ └── kern_dmul2_x_pq_qp_impl.h │ ├── dmuladd1 │ │ └── kern_dmuladd1.C │ ├── kern_apply.h │ ├── kern_applyadd.h │ ├── kern_dadd1.h │ ├── kern_dadd2.h │ ├── kern_dcopy.h │ ├── kern_ddiv1.h │ ├── kern_ddiv2.h │ ├── kern_ddivadd1.h │ ├── kern_dmul1.h │ ├── kern_dmul2.h │ ├── kern_dmuladd1.h │ ├── kernel_base.h │ ├── loop_list_node.h │ ├── loop_list_runner.h │ ├── loop_registers.h │ └── overflow.h ├── libtensor.h ├── libxm │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── example.c │ ├── src │ │ ├── Makefile │ │ ├── alloc.c │ │ ├── alloc.h │ │ ├── bitmap.h │ │ ├── blockspace.c │ │ ├── blockspace.h │ │ ├── contract.c │ │ ├── dim.c │ │ ├── dim.h │ │ ├── scalar.c │ │ ├── scalar.h │ │ ├── tensor.c │ │ ├── tensor.h │ │ ├── util.c │ │ ├── util.h │ │ ├── xm.c │ │ └── xm.h │ └── test.c ├── linalg.h ├── linalg │ ├── acml │ │ ├── lapack_acml.C │ │ ├── linalg_acml.h │ │ ├── linalg_acml_level1.C │ │ ├── linalg_acml_level1.h │ │ ├── linalg_acml_level2.C │ │ ├── linalg_acml_level2.h │ │ ├── linalg_acml_level3.C │ │ └── linalg_acml_level3.h │ ├── cblas │ │ ├── cblas_h.h │ │ ├── linalg_cblas.h │ │ ├── linalg_cblas_level1.C │ │ ├── linalg_cblas_level1.h │ │ ├── linalg_cblas_level2.C │ │ ├── linalg_cblas_level2.h │ │ ├── linalg_cblas_level3.C │ │ └── linalg_cblas_level3.h │ ├── essl │ │ ├── essl_h.h │ │ ├── linalg_essl.h │ │ ├── linalg_essl_level1.C │ │ ├── linalg_essl_level1.h │ │ ├── linalg_essl_level2.C │ │ ├── linalg_essl_level2.h │ │ ├── linalg_essl_level3.C │ │ └── linalg_essl_level3.h │ ├── generic │ │ ├── linalg_generic.h │ │ ├── linalg_generic_level1.C │ │ ├── linalg_generic_level1.h │ │ ├── linalg_generic_level2.C │ │ ├── linalg_generic_level2.h │ │ ├── linalg_generic_level3.C │ │ └── linalg_generic_level3.h │ ├── gsl │ │ └── linalg_gsl.h │ ├── lapack_acml.h │ ├── lapack_essl.h │ ├── lapack_generic.h │ ├── lapack_mkl.h │ ├── linalg.h │ ├── linalg_timings.h │ ├── mkl │ │ ├── lapack_mkl.C │ │ ├── linalg_mkl.h │ │ ├── linalg_mkl_level1.C │ │ ├── linalg_mkl_level1.h │ │ ├── linalg_mkl_level2.C │ │ ├── linalg_mkl_level2.h │ │ ├── linalg_mkl_level3.C │ │ └── linalg_mkl_level3.h │ └── qchem │ │ ├── linalg_qchem.h │ │ ├── linalg_qchem_level1.C │ │ ├── linalg_qchem_level1.h │ │ ├── linalg_qchem_level2.C │ │ ├── linalg_qchem_level2.h │ │ ├── linalg_qchem_level3.C │ │ └── linalg_qchem_level3.h ├── not_implemented.h ├── symmetry │ ├── bad_symmetry.h │ ├── block_labeling.h │ ├── eval_sequence_list.h │ ├── evaluation_rule.h │ ├── inst │ │ ├── adjacency_list.C │ │ ├── adjacency_list.h │ │ ├── block_labeling_impl.h │ │ ├── block_labeling_inst.C │ │ ├── combine_label.h │ │ ├── combine_label_impl.h │ │ ├── combine_label_inst.C │ │ ├── combine_part.h │ │ ├── combine_part_impl.h │ │ ├── combine_part_inst.C │ │ ├── er_merge.h │ │ ├── er_merge_impl.h │ │ ├── er_merge_inst.C │ │ ├── er_optimize.h │ │ ├── er_optimize_impl.h │ │ ├── er_optimize_inst.C │ │ ├── er_reduce.h │ │ ├── er_reduce_impl.h │ │ ├── er_reduce_inst.C │ │ ├── evaluation_rule_impl.h │ │ ├── evaluation_rule_inst.C │ │ ├── permutation_group_impl.h │ │ ├── permutation_group_inst.C │ │ ├── print_symmetry_inst.C │ │ ├── se_label_impl.h │ │ ├── se_label_inst.C │ │ ├── se_part_impl.h │ │ ├── se_part_inst.C │ │ ├── se_perm_impl.h │ │ ├── se_perm_inst.C │ │ ├── so_apply_impl.h │ │ ├── so_apply_inst.C │ │ ├── so_apply_se_label_impl.h │ │ ├── so_apply_se_label_inst.C │ │ ├── so_apply_se_part_impl.h │ │ ├── so_apply_se_part_inst.C │ │ ├── so_apply_se_perm_impl.h │ │ ├── so_apply_se_perm_inst.C │ │ ├── so_copy_impl.h │ │ ├── so_copy_inst.C │ │ ├── so_dirprod_impl.h │ │ ├── so_dirprod_inst.C │ │ ├── so_dirprod_se_label_impl.h │ │ ├── so_dirprod_se_label_inst.C │ │ ├── so_dirprod_se_part_impl.h │ │ ├── so_dirprod_se_part_inst.C │ │ ├── so_dirprod_se_perm_impl.h │ │ ├── so_dirprod_se_perm_inst.C │ │ ├── so_dirsum_impl.h │ │ ├── so_dirsum_inst.C │ │ ├── so_dirsum_se_label_impl.h │ │ ├── so_dirsum_se_label_inst.C │ │ ├── so_dirsum_se_part_impl.h │ │ ├── so_dirsum_se_part_inst.C │ │ ├── so_dirsum_se_perm_impl.h │ │ ├── so_dirsum_se_perm_inst.C │ │ ├── so_merge_impl.h │ │ ├── so_merge_inst.C │ │ ├── so_merge_se_label_impl.h │ │ ├── so_merge_se_label_inst.C │ │ ├── so_merge_se_part_impl.h │ │ ├── so_merge_se_part_inst.C │ │ ├── so_merge_se_perm_impl.h │ │ ├── so_merge_se_perm_inst.C │ │ ├── so_permute_impl.h │ │ ├── so_permute_inst.C │ │ ├── so_permute_se_label_impl.h │ │ ├── so_permute_se_label_inst.C │ │ ├── so_permute_se_part_impl.h │ │ ├── so_permute_se_part_inst.C │ │ ├── so_permute_se_perm_impl.h │ │ ├── so_permute_se_perm_inst.C │ │ ├── so_reduce_impl.h │ │ ├── so_reduce_inst.C │ │ ├── so_reduce_se_label_impl.h │ │ ├── so_reduce_se_label_inst.C │ │ ├── so_reduce_se_part_impl.h │ │ ├── so_reduce_se_part_inst.C │ │ ├── so_reduce_se_perm_impl.h │ │ ├── so_reduce_se_perm_inst.C │ │ ├── so_symmetrize_impl.h │ │ ├── so_symmetrize_inst.C │ │ ├── so_symmetrize_se_label_impl.h │ │ ├── so_symmetrize_se_label_inst.C │ │ ├── so_symmetrize_se_part_impl.h │ │ ├── so_symmetrize_se_part_inst.C │ │ ├── so_symmetrize_se_perm_impl.h │ │ └── so_symmetrize_se_perm_inst.C │ ├── permutation_group.h │ ├── point_group_table.C │ ├── point_group_table.h │ ├── print_symmetry.h │ ├── product_rule.h │ ├── product_table_container.C │ ├── product_table_container.h │ ├── product_table_i.C │ ├── product_table_i.h │ ├── se_label.h │ ├── se_part.h │ ├── se_perm.h │ ├── so_apply.h │ ├── so_apply_handlers.h │ ├── so_apply_se_label.h │ ├── so_apply_se_part.h │ ├── so_apply_se_perm.h │ ├── so_copy.h │ ├── so_dirprod.h │ ├── so_dirprod_handlers.h │ ├── so_dirprod_se_label.h │ ├── so_dirprod_se_part.h │ ├── so_dirprod_se_perm.h │ ├── so_dirsum.h │ ├── so_dirsum_handlers.h │ ├── so_dirsum_se_label.h │ ├── so_dirsum_se_part.h │ ├── so_dirsum_se_perm.h │ ├── so_merge.h │ ├── so_merge_handlers.h │ ├── so_merge_se_label.h │ ├── so_merge_se_part.h │ ├── so_merge_se_perm.h │ ├── so_permute.h │ ├── so_permute_handlers.h │ ├── so_permute_se_label.h │ ├── so_permute_se_part.h │ ├── so_permute_se_perm.h │ ├── so_reduce.h │ ├── so_reduce_handlers.h │ ├── so_reduce_se_label.h │ ├── so_reduce_se_part.h │ ├── so_reduce_se_perm.h │ ├── so_symmetrize.h │ ├── so_symmetrize_handlers.h │ ├── so_symmetrize_se_label.h │ ├── so_symmetrize_se_part.h │ ├── so_symmetrize_se_perm.h │ ├── symmetry_element_set_adapter.h │ ├── symmetry_element_target.h │ ├── symmetry_operation_base.h │ ├── symmetry_operation_dispatcher.h │ ├── symmetry_operation_handlers.h │ ├── symmetry_operation_impl.h │ ├── symmetry_operation_impl_base.h │ ├── symmetry_operation_impl_i.h │ └── symmetry_operation_params.h ├── timings.h ├── version.C └── version.h ├── libutil ├── CMakeLists.txt ├── exceptions │ ├── backtrace.C │ ├── backtrace.h │ ├── exception.C │ ├── exception.h │ ├── exception_base.h │ ├── rethrowable_i.C │ ├── rethrowable_i.h │ └── util_exceptions.h ├── singleton.h ├── thread_pool │ ├── task_i.h │ ├── task_info.h │ ├── task_iterator_i.h │ ├── task_observer_i.h │ ├── task_source.C │ ├── task_source.h │ ├── task_source_mpi.C │ ├── task_thief.C │ ├── task_thief.h │ ├── thread_pool.C │ ├── thread_pool.h │ ├── thread_pool_info.h │ ├── unknown_exception.C │ ├── unknown_exception.h │ ├── worker.C │ └── worker.h ├── threads │ ├── auto_lock.h │ ├── base │ │ ├── cond_base.h │ │ ├── mutex_base.h │ │ ├── rwlock_base.h │ │ ├── thread_base.h │ │ └── thread_i.h │ ├── builtin │ │ └── tls_builtin.h │ ├── cond.h │ ├── cond_map.h │ ├── loaded_cond.h │ ├── macos │ │ ├── spinlock_macos.C │ │ └── spinlock_macos.h │ ├── mutex.h │ ├── posix │ │ ├── cond_posix.C │ │ ├── cond_posix.h │ │ ├── mutex_posix.C │ │ ├── mutex_posix.h │ │ ├── rwlock_posix.C │ │ ├── rwlock_posix.h │ │ ├── spinlock_posix.C │ │ ├── spinlock_posix.h │ │ ├── thread_posix.C │ │ ├── thread_posix.h │ │ ├── tls_posix.C │ │ └── tls_posix.h │ ├── rwlock.h │ ├── spinlock.h │ ├── thread.h │ ├── tls.h │ └── windows │ │ ├── cond_windows.h │ │ ├── mutex_windows.h │ │ ├── rwlock_windows.h │ │ ├── rwlock_windows_srw.h │ │ ├── spinlock_windows.h │ │ ├── thread_windows.h │ │ ├── tls_windows.C │ │ └── tls_windows.h ├── timings │ ├── local_timings_store.h │ ├── local_timings_store_base.C │ ├── local_timings_store_base.h │ ├── timer.C │ ├── timer.h │ ├── timer_defs.h │ ├── timer_defs_gettimeofday.h │ ├── timer_defs_posix.h │ ├── timing_record.h │ ├── timings.h │ ├── timings_store.C │ └── timings_store.h ├── version.C └── version.h ├── performance_tests ├── CMakeLists.txt ├── bispace_data.h ├── dimensions_data.h ├── expression_performance_test.h ├── expression_test_scenario.h ├── libtensor_ctf_benchmarks ├── libtensor_ctf_benchmarks.C ├── libtensor_performance_tests.C ├── libtensor_pt_suite.C ├── libtensor_pt_suite.h ├── performance_test.h ├── performance_test_scenario_i.h ├── performance_test_suite.C ├── performance_test_suite.h ├── test_expression_i.h ├── test_expressions.C ├── test_expressions.h ├── tod_add_performance.h ├── tod_add_scenario.h ├── tod_contract2_performance.h ├── tod_contract2_scenario.h ├── tod_copy_performance.h ├── tod_copy_scenario.h ├── tod_dotprod_performance.h └── tod_dotprod_scenario.h └── tests ├── CMakeLists.txt ├── block_sparse ├── alkane_aTZ_ithrsh_10_010_data.txt ├── alkane_aTZ_ithrsh_10_atom_blocked_010_data.txt ├── alkane_aTZ_ithrsh_14_atom_blocked_010_data.txt ├── alkane_dz_003_data.txt ├── alkane_dz_010_data.txt ├── alkane_dz_020_data.txt ├── alkane_dz_atom_blocked_010_data.txt ├── alkane_dz_atom_blocked_020_data.txt ├── alkane_tz_010_data.txt ├── anthracene_dz_atom_blocked.txt ├── batch_kernels_test.C ├── batch_kernels_test.h ├── batch_list_builder_test.C ├── batch_list_builder_test.h ├── batch_provider_test.C ├── batch_provider_test.h ├── blas_isomorphism_test.C ├── blas_isomorphism_test.h ├── block_kernels_test.C ├── block_kernels_test.h ├── block_loop_test.C ├── block_loop_test.h ├── direct_sparse_btensor_test.C ├── direct_sparse_btensor_test.h ├── graphene_01_03_sig_blocks_NN.txt ├── graphene_01_03_sig_blocks_NX.txt ├── graphene_01_03_split_points_N.txt ├── graphene_01_03_split_points_X.txt ├── graphene_01_06_sig_blocks.txt ├── graphene_01_06_split_points.txt ├── libtensor_block_sparse_benchmark.C ├── libtensor_block_sparse_suite.C ├── libtensor_block_sparse_suite.h ├── libtensor_block_sparse_tests.C ├── sparse_bispace_test.C ├── sparse_bispace_test.h ├── sparse_block_tree_benchmark.C ├── sparse_block_tree_iterator_test.C ├── sparse_block_tree_iterator_test.h ├── sparse_block_tree_test.C ├── sparse_block_tree_test.h ├── sparse_btensor_test.C ├── sparse_btensor_test.h ├── sparse_loop_grouper_test.C ├── sparse_loop_grouper_test.h ├── sparse_loop_list_test.C ├── sparse_loop_list_test.h ├── sparsity_fuser_test.C ├── sparsity_fuser_test.h ├── subspace_iterator_test.C ├── subspace_iterator_test.h ├── test_fixtures │ ├── contract2_test_f.C │ ├── contract2_test_f.h │ ├── index_group_test_f.h │ ├── permute_3d_sparse_120_test_f.C │ ├── permute_3d_sparse_120_test_f.h │ └── util.h ├── timer.C └── timer.h ├── block_tensor ├── addition_schedule_test.C ├── addition_schedule_test.h ├── block_tensor_test.C ├── block_tensor_test.h ├── bto_contract2_bis_test.C ├── bto_contract2_bis_test.h ├── bto_contract2_sym_test.C ├── bto_contract2_sym_test.h ├── btod_add_test.C ├── btod_add_test.h ├── btod_apply_test.C ├── btod_apply_test.h ├── btod_compare_test.C ├── btod_compare_test.h ├── btod_contract2_test.C ├── btod_contract2_test.h ├── btod_contract2_xm_test.C ├── btod_contract2_xm_test.h ├── btod_contract3_test.C ├── btod_contract3_test.h ├── btod_copy_test.C ├── btod_copy_test.h ├── btod_diag_test.C ├── btod_diag_test.h ├── btod_diagonalize_test.C ├── btod_diagonalize_test.h ├── btod_dirsum_test.C ├── btod_dirsum_test.h ├── btod_dotprod_test.C ├── btod_dotprod_test.h ├── btod_ewmult2_test.C ├── btod_ewmult2_test.h ├── btod_extract_test.C ├── btod_extract_test.h ├── btod_import_raw_stream_test.C ├── btod_import_raw_stream_test.h ├── btod_import_raw_test.C ├── btod_import_raw_test.h ├── btod_mult1_test.C ├── btod_mult1_test.h ├── btod_mult_test.C ├── btod_mult_test.h ├── btod_print_test.C ├── btod_print_test.h ├── btod_random_test.C ├── btod_random_test.h ├── btod_read_test.C ├── btod_read_test.h ├── btod_scale_test.C ├── btod_scale_test.h ├── btod_select_test.C ├── btod_select_test.h ├── btod_set_diag_test.C ├── btod_set_diag_test.h ├── btod_set_elem_test.C ├── btod_set_elem_test.h ├── btod_set_test.C ├── btod_set_test.h ├── btod_shift_diag_test.C ├── btod_shift_diag_test.h ├── btod_sum_test.C ├── btod_sum_test.h ├── btod_symcontract3_test.C ├── btod_symcontract3_test.h ├── btod_symmetrize2_test.C ├── btod_symmetrize2_test.h ├── btod_symmetrize3_test.C ├── btod_symmetrize3_test.h ├── btod_symmetrize4_test.C ├── btod_symmetrize4_test.h ├── btod_trace_test.C ├── btod_trace_test.h ├── btod_tridiagonalize_test.C ├── btod_tridiagonalize_test.h ├── btod_vmpriority_test.C ├── btod_vmpriority_test.h ├── direct_block_tensor_test.C ├── direct_block_tensor_test.h ├── gen_bto_aux_add_test.C ├── gen_bto_aux_add_test.h ├── gen_bto_aux_copy_test.C ├── gen_bto_aux_copy_test.h ├── gen_bto_contract2_clst_builder_test.C ├── gen_bto_contract2_clst_builder_test.h ├── gen_bto_dirsum_sym_test.C ├── gen_bto_dirsum_sym_test.h ├── gen_bto_symcontract2_sym_test.C ├── gen_bto_symcontract2_sym_test.h ├── gen_bto_unfold_symmetry_test.C ├── gen_bto_unfold_symmetry_test.h ├── libtensor_block_tensor_suite.C ├── libtensor_block_tensor_suite.h └── libtensor_block_tensor_tests.C ├── compare_ref.h ├── core ├── CMakeLists.txt ├── abs_index_test.C ├── block_index_space_product_builder_test.C ├── block_index_space_test.C ├── block_index_subspace_builder_test.C ├── block_map_test.C ├── combined_orbits_test.C ├── contraction2_list_builder_test.C ├── contraction2_test.C ├── dimensions_test.C ├── immutable_test.C ├── index_range_test.C ├── index_test.C ├── magic_dimensions_test.C ├── mask_test.C ├── orbit_list_test.C ├── orbit_test.C ├── permutation_builder_test.C ├── permutation_generator_test.C ├── permutation_test.C ├── sequence_generator_test.C ├── sequence_test.C ├── short_orbit_test.C ├── subgroup_orbits_test.C ├── symmetry_element_set_test.C ├── symmetry_test.C ├── transf_list_test.C └── version_test.C ├── ctf_block_tensor ├── ctf_btod_collect_test.C ├── ctf_btod_collect_test.h ├── ctf_btod_contract2_test.C ├── ctf_btod_contract2_test.h ├── ctf_btod_copy_test.C ├── ctf_btod_copy_test.h ├── ctf_btod_diag_test.C ├── ctf_btod_diag_test.h ├── ctf_btod_dirsum_test.C ├── ctf_btod_dirsum_test.h ├── ctf_btod_distribute_test.C ├── ctf_btod_distribute_test.h ├── ctf_btod_dotprod_test.C ├── ctf_btod_dotprod_test.h ├── ctf_btod_ewmult2_test.C ├── ctf_btod_ewmult2_test.h ├── ctf_btod_mult1_test.C ├── ctf_btod_mult1_test.h ├── ctf_btod_mult_test.C ├── ctf_btod_mult_test.h ├── ctf_btod_random_test.C ├── ctf_btod_random_test.h ├── ctf_btod_scale_test.C ├── ctf_btod_scale_test.h ├── ctf_btod_set_test.C ├── ctf_btod_set_test.h ├── ctf_btod_symmetrize2_test.C ├── ctf_btod_symmetrize2_test.h ├── ctf_btod_symmetrize3_test.C ├── ctf_btod_symmetrize3_test.h ├── ctf_btod_trace_test.C ├── ctf_btod_trace_test.h ├── ctf_symmetry_builder_test.C ├── ctf_symmetry_builder_test.h ├── libtensor_ctf_block_tensor_suite.C ├── libtensor_ctf_block_tensor_suite.h └── libtensor_ctf_block_tensor_tests.C ├── ctf_dense_tensor ├── ctf_dense_tensor_test.C ├── ctf_dense_tensor_test.h ├── ctf_symmetry_test.C ├── ctf_symmetry_test.h ├── ctf_symmetry_test_equals.h ├── ctf_tod_contract2_test.C ├── ctf_tod_contract2_test.h ├── ctf_tod_copy_test.C ├── ctf_tod_copy_test.h ├── ctf_tod_diag_test.C ├── ctf_tod_diag_test.h ├── ctf_tod_dirsum_test.C ├── ctf_tod_dirsum_test.h ├── ctf_tod_distribute_test.C ├── ctf_tod_distribute_test.h ├── ctf_tod_dotprod_test.C ├── ctf_tod_dotprod_test.h ├── ctf_tod_ewmult2_test.C ├── ctf_tod_ewmult2_test.h ├── ctf_tod_mult1_test.C ├── ctf_tod_mult1_test.h ├── ctf_tod_mult_test.C ├── ctf_tod_mult_test.h ├── ctf_tod_random_test.C ├── ctf_tod_random_test.h ├── ctf_tod_scale_test.C ├── ctf_tod_scale_test.h ├── ctf_tod_scatter_test.C ├── ctf_tod_scatter_test.h ├── ctf_tod_set_diag_test.C ├── ctf_tod_set_diag_test.h ├── ctf_tod_set_symmetry_test.C ├── ctf_tod_set_symmetry_test.h ├── ctf_tod_set_test.C ├── ctf_tod_set_test.h ├── ctf_tod_trace_test.C ├── ctf_tod_trace_test.h ├── libtensor_ctf_dense_tensor_suite.C ├── libtensor_ctf_dense_tensor_suite.h └── libtensor_ctf_dense_tensor_tests.C ├── ctf_iface ├── ctf_btensor_test.C ├── ctf_btensor_test.h ├── ctf_dot_product_test.C ├── ctf_dot_product_test.h ├── ctf_expr_test.C ├── ctf_expr_test.h ├── ctf_mult_test.C ├── ctf_mult_test.h ├── ctf_set_test.C ├── ctf_set_test.h ├── ctf_trace_test.C ├── ctf_trace_test.h ├── libtensor_ctf_iface_suite.C ├── libtensor_ctf_iface_suite.h └── libtensor_ctf_iface_tests.C ├── dense_tensor ├── CMakeLists.txt ├── dense_tensor_test.C ├── to_contract2_dims_test.C ├── tod_add_test.C ├── tod_apply_test.C ├── tod_btconv_test.C ├── tod_compare_test.C ├── tod_contract2_test.C ├── tod_copy_test.C ├── tod_copy_wnd_test.C ├── tod_diag_test.C ├── tod_dirsum_test.C ├── tod_dotprod_test.C ├── tod_ewmult2_test.C ├── tod_extract_test.C ├── tod_import_raw_stream_test.C ├── tod_import_raw_test.C ├── tod_mult1_test.C ├── tod_mult_test.C ├── tod_random_test.C ├── tod_scale_test.C ├── tod_scatter_test.C ├── tod_select_test.C ├── tod_set_diag_test.C ├── tod_set_elem_test.C ├── tod_set_test.C ├── tod_size_test.C ├── tod_trace_test.C └── tod_vmpriority_test.C ├── diag_block_tensor ├── diag_block_tensor_test.C ├── diag_block_tensor_test.h ├── diag_btod_contract2_test.C ├── diag_btod_contract2_test.h ├── diag_btod_copy_test.C ├── diag_btod_copy_test.h ├── diag_btod_random_test.C ├── diag_btod_random_test.h ├── libtensor_diag_block_tensor_suite.C ├── libtensor_diag_block_tensor_suite.h ├── libtensor_diag_block_tensor_tests.C ├── tod_conv_diag_block_tensor_test.C └── tod_conv_diag_block_tensor_test.h ├── diag_tensor ├── diag_tensor_space_test.C ├── diag_tensor_space_test.h ├── diag_tensor_subspace_test.C ├── diag_tensor_subspace_test.h ├── diag_tensor_test.C ├── diag_tensor_test.h ├── diag_to_add_space_test.C ├── diag_to_add_space_test.h ├── diag_to_contract2_space_test.C ├── diag_to_contract2_space_test.h ├── diag_tod_adjust_space_test.C ├── diag_tod_adjust_space_test.h ├── diag_tod_contract2_part_test.C ├── diag_tod_contract2_part_test.h ├── diag_tod_contract2_test.C ├── diag_tod_contract2_test.h ├── diag_tod_copy_test.C ├── diag_tod_copy_test.h ├── diag_tod_dotprod_test.C ├── diag_tod_dotprod_test.h ├── diag_tod_mult1_test.C ├── diag_tod_mult1_test.h ├── diag_tod_random_test.C ├── diag_tod_random_test.h ├── diag_tod_set_test.C ├── diag_tod_set_test.h ├── libtensor_diag_tensor_suite.C ├── libtensor_diag_tensor_suite.h ├── libtensor_diag_tensor_tests.C ├── tod_conv_diag_tensor_test.C └── tod_conv_diag_tensor_test.h ├── expr ├── expr_tree_test.C ├── expr_tree_test.h ├── graph_test.C ├── graph_test.h ├── libtensor_expr_suite.C ├── libtensor_expr_suite.h ├── libtensor_expr_tests.C ├── node_add_test.C ├── node_add_test.h ├── node_contract_test.C ├── node_contract_test.h ├── node_diag_test.C ├── node_diag_test.h ├── node_dot_product_test.C ├── node_dot_product_test.h ├── node_ident_any_tensor_test.C ├── node_ident_any_tensor_test.h ├── node_product_test.C ├── node_product_test.h ├── node_scalar_test.C ├── node_scalar_test.h ├── node_set_test.C ├── node_set_test.h ├── node_trace_test.C ├── node_trace_test.h ├── node_transform_test.C └── node_transform_test.h ├── iface ├── any_tensor_test.C ├── any_tensor_test.h ├── bispace_expr_test.C ├── bispace_expr_test.h ├── bispace_test.C ├── bispace_test.h ├── btensor_test.C ├── btensor_test.h ├── contract_test.C ├── contract_test.h ├── diag_test.C ├── diag_test.h ├── direct_product_test.C ├── direct_product_test.h ├── dirsum_test.C ├── dirsum_test.h ├── dot_product_test.C ├── dot_product_test.h ├── eval_btensor_double_test.C ├── eval_btensor_double_test.h ├── eval_register_test.C ├── eval_register_test.h ├── ewmult_test.C ├── ewmult_test.h ├── expr_tensor_test.C ├── expr_tensor_test.h ├── expr_test.C ├── expr_test.h ├── letter_expr_test.C ├── letter_expr_test.h ├── letter_test.C ├── letter_test.h ├── libtensor_iface_suite.C ├── libtensor_iface_suite.h ├── libtensor_iface_tests.C ├── mult_test.C ├── mult_test.h ├── set_test.C ├── set_test.h ├── symm_test.C ├── symm_test.h ├── trace_test.C └── trace_test.h ├── libtensor_block_tensor_tests ├── libtensor_core_tests ├── libtensor_ctf_block_tensor_tests ├── libtensor_ctf_dense_tensor_tests ├── libtensor_ctf_iface_tests ├── libtensor_dense_tensor_tests ├── libtensor_diag_block_tensor_tests ├── libtensor_diag_tensor_tests ├── libtensor_expr_tests ├── libtensor_iface_tests ├── libtensor_symmetry_tests ├── linalg ├── CMakeLists.txt ├── linalg_add_i_i_x_x_test.C ├── linalg_copy_ij_ji_test.C ├── linalg_mul2_i_i_i_x_test.C ├── linalg_mul2_i_i_x_test.C ├── linalg_mul2_i_ip_p_x_test.C ├── linalg_mul2_i_ipq_qp_x_test.C ├── linalg_mul2_i_pi_p_x_test.C ├── linalg_mul2_ij_i_j_x_test.C ├── linalg_mul2_ij_ip_jp_x_test.C ├── linalg_mul2_ij_ip_pj_x_test.C ├── linalg_mul2_ij_pi_jp_x_test.C ├── linalg_mul2_ij_pi_pj_x_test.C ├── linalg_mul2_x_p_p_test.C ├── linalg_mul2_x_pq_pq_test.C ├── linalg_mul2_x_pq_qp_test.C └── test_utils.h ├── symmetry ├── CMakeLists.txt ├── adjacency_list_test.C ├── adjacency_list_test.h ├── block_labeling_test.C ├── block_labeling_test.h ├── combine_label_test.C ├── combine_label_test.h ├── combine_part_test.C ├── combine_part_test.h ├── er_merge_test.C ├── er_merge_test.h ├── er_optimize_test.C ├── er_optimize_test.h ├── er_reduce_test.C ├── er_reduce_test.h ├── eval_sequence_list_test.C ├── eval_sequence_list_test.h ├── evaluation_rule_test.C ├── evaluation_rule_test.h ├── libtensor_symmetry_suite.C ├── libtensor_symmetry_suite.h ├── libtensor_symmetry_tests.C ├── permutation_group_test.C ├── permutation_group_test.h ├── point_group_table_test.C ├── point_group_table_test.h ├── product_rule_test.C ├── product_rule_test.h ├── product_table_container_test.C ├── product_table_container_test.h ├── se_label_test.C ├── se_label_test.h ├── se_label_test_base.C ├── se_label_test_base.h ├── se_part_test.C ├── se_part_test.h ├── se_perm_test.C ├── se_perm_test.h ├── so_apply_se_label_test.C ├── so_apply_se_label_test.h ├── so_apply_se_part_test.C ├── so_apply_se_part_test.h ├── so_apply_se_perm_test.C ├── so_apply_se_perm_test.h ├── so_apply_test.C ├── so_apply_test.h ├── so_copy_test.C ├── so_copy_test.h ├── so_dirprod_se_label_test.C ├── so_dirprod_se_label_test.h ├── so_dirprod_se_part_test.C ├── so_dirprod_se_part_test.h ├── so_dirprod_se_perm_test.C ├── so_dirprod_se_perm_test.h ├── so_dirprod_test.C ├── so_dirprod_test.h ├── so_dirsum_se_label_test.C ├── so_dirsum_se_label_test.h ├── so_dirsum_se_part_test.C ├── so_dirsum_se_part_test.h ├── so_dirsum_se_perm_test.C ├── so_dirsum_se_perm_test.h ├── so_dirsum_test.C ├── so_dirsum_test.h ├── so_merge_se_label_test.C ├── so_merge_se_label_test.h ├── so_merge_se_part_test.C ├── so_merge_se_part_test.h ├── so_merge_se_perm_test.C ├── so_merge_se_perm_test.h ├── so_merge_test.C ├── so_merge_test.h ├── so_permute_se_label_test.C ├── so_permute_se_label_test.h ├── so_permute_se_part_test.C ├── so_permute_se_part_test.h ├── so_permute_se_perm_test.C ├── so_permute_se_perm_test.h ├── so_reduce_se_label_test.C ├── so_reduce_se_label_test.h ├── so_reduce_se_part_test.C ├── so_reduce_se_part_test.h ├── so_reduce_se_perm_test.C ├── so_reduce_se_perm_test.h ├── so_reduce_test.C ├── so_reduce_test.h ├── so_symmetrize_se_label_test.C ├── so_symmetrize_se_label_test.h ├── so_symmetrize_se_part_test.C ├── so_symmetrize_se_part_test.h ├── so_symmetrize_test.C ├── so_symmetrize_test.h ├── symmetry_element_set_adapter_test.C └── symmetry_element_set_adapter_test.h └── test_utils.h /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .cproject 3 | .settings 4 | .svn 5 | .DS_Store 6 | build 7 | tests/libtensor_tests 8 | docs 9 | 10 | -------------------------------------------------------------------------------- /cmake/FindCBLAS.cmake: -------------------------------------------------------------------------------- 1 | set(CBLAS_FOUND FALSE) 2 | 3 | find_path(CBLAS_INCLUDE_PATH cblas.h) 4 | 5 | if(CBLAS_INCLUDE_PATH) 6 | 7 | set(CBLAS_FOUND TRUE) 8 | 9 | set(CBLAS_LIBRARIES blas) 10 | 11 | if(NOT CBLAS_FIND_QUIETLY) 12 | message(STATUS "Found CBLAS: " ${CBLAS_INCLUDE_PATH}) 13 | endif(NOT CBLAS_FIND_QUIETLY) 14 | 15 | endif(CBLAS_INCLUDE_PATH) 16 | 17 | -------------------------------------------------------------------------------- /cmake/FindGSL.cmake: -------------------------------------------------------------------------------- 1 | set(GSL_FOUND FALSE) 2 | 3 | find_path(GSL_INCLUDE_PATH gsl/gsl_cblas.h PATHS "C:/Program Files/GnuWin32" PATH_SUFFIXES include) 4 | 5 | if(GSL_INCLUDE_PATH) 6 | 7 | set(GSL_FOUND TRUE) 8 | 9 | get_filename_component(GSL_LIB_PATH ${GSL_INCLUDE_PATH}/../lib ABSOLUTE) 10 | find_library(GSL_GSL_A gsl PATHS ${GSL_LIB_PATH}) 11 | find_library(GSL_GSLCBLAS_A gslcblas PATHS ${GSL_LIB_PATH}) 12 | set(GSL_LIBRARIES ${GSL_GSL_A} ${GSL_GSLCBLAS_A}) 13 | 14 | if(NOT GSL_FIND_QUIETLY) 15 | message(STATUS "Found GSL: " ${GSL_INCLUDE_PATH}) 16 | endif(NOT GSL_FIND_QUIETLY) 17 | 18 | endif(GSL_INCLUDE_PATH) 19 | 20 | -------------------------------------------------------------------------------- /cmake/FindLAPACK.cmake: -------------------------------------------------------------------------------- 1 | set(LAPACK_FOUND FALSE) 2 | 3 | find_library(LAPACK_LIBRARY_PATH lapack) 4 | 5 | if(LAPACK_LIBRARY_PATH) 6 | set(LAPACK_FOUND TRUE) 7 | set(LAPACK_LIBRARIES LAPACK_LIBRARY_PATH) 8 | 9 | if(NOT LAPACK_FIND_QUIETLY) 10 | message(STATUS "Found generic LAPACK: " ${LAPACK_LIBRARY_PATH}) 11 | endif(NOT LAPACK_FIND_QUIETLY) 12 | 13 | endif(LAPACK_LIBRARY_PATH) 14 | 15 | -------------------------------------------------------------------------------- /cmake/SetupLibTensor.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Set up libtensor as an external library 3 | # 4 | 5 | include(${LIBTENSOR_DIR}/cmake/DepsLibTensor.txt) 6 | 7 | # Include and library paths 8 | # 9 | include_directories(${LIBTENSOR_DIR} ${ARMADILLO_INCLUDE_DIRS}) 10 | add_library(tensor_core STATIC IMPORTED) 11 | set_target_properties(tensor_core PROPERTIES 12 | IMPORTED_LOCATION ${LIBTENSOR_DIR}/build/libtensor/libtensor_core.a) 13 | add_library(tensor STATIC IMPORTED) 14 | set_target_properties(tensor PROPERTIES 15 | IMPORTED_LOCATION ${LIBTENSOR_DIR}/build/libtensor/libtensor.a) 16 | set(LIBTENSOR_LIBS tensor tensor_core ${LIBTENSOR_DEP_LIBS}) 17 | 18 | -------------------------------------------------------------------------------- /cmake/SetupLibUtil.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Set up libutil as an external library 3 | # 4 | 5 | include(${LIBUTIL_DIR}/cmake/DepsLibUtil.txt) 6 | 7 | # 8 | # Include and library paths 9 | # 10 | include_directories(${LIBUTIL_DIR}) 11 | #add_library(util STATIC IMPORTED) 12 | #set_target_properties(util PROPERTIES 13 | # IMPORTED_LOCATION ${LIBUTIL_DIR}/build/libutil/libutil.a 14 | #) 15 | #set(LIBUTIL_LIBS util ${LIBUTIL_DEP_LIBS}) 16 | 17 | -------------------------------------------------------------------------------- /libtensor/arma/impl/btod_export_arma.C: -------------------------------------------------------------------------------- 1 | #include "btod_export_arma_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class btod_export_arma<1>; 7 | template class btod_export_arma<2>; 8 | template class btod_export_arma<3>; 9 | template class btod_export_arma<4>; 10 | template class btod_export_arma<5>; 11 | template class btod_export_arma<6>; 12 | template class btod_export_arma<7>; 13 | template class btod_export_arma<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/block_sparse/batch_kernel.h: -------------------------------------------------------------------------------- 1 | #ifndef BATCH_KERNEL_H 2 | #define BATCH_KERNEL_H 3 | 4 | #include "sparse_defs.h" 5 | 6 | namespace libtensor { 7 | 8 | template 9 | class batch_kernel 10 | { 11 | public: 12 | virtual void generate_batch(const std::vector& ptrs,const bispace_batch_map& batches) = 0; 13 | virtual void init(const std::vector& ptrs,const bispace_batch_map& bbm) {} 14 | virtual ~batch_kernel() { } 15 | }; 16 | 17 | } // namespace libtensor 18 | 19 | #endif /* BATCH_KERNEL_H */ 20 | -------------------------------------------------------------------------------- /libtensor/block_sparse/batch_list_builder.h: -------------------------------------------------------------------------------- 1 | #ifndef BATCH_LIST_BUILDER_H 2 | #define BATCH_LIST_BUILDER_H 3 | 4 | #include "subspace_iterator.h" 5 | #include "connectivity.h" 6 | 7 | namespace libtensor { 8 | 9 | class batch_list_builder 10 | { 11 | private: 12 | std::vector< std::vector > m_iter_grps; 13 | size_t m_end_idx; 14 | public: 15 | batch_list_builder(const std::vector< std::vector >& bispace_grps, 16 | const std::vector& batched_subspace_grps); 17 | 18 | idx_pair_list get_batch_list(size_t max_n_elem); 19 | std::vector< std::vector > get_batch_array_size_grps(const idx_pair_list& batch_list); 20 | }; 21 | 22 | } // namespace libtensor 23 | 24 | #endif /* BATCH_LIST_BUILDER_H */ 25 | -------------------------------------------------------------------------------- /libtensor/block_sparse/block_kernel_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * block_kernel_i_new.h 3 | * 4 | * Created on: Nov 13, 2013 5 | * Author: smanzer 6 | */ 7 | 8 | #ifndef BLOCK_KERNEL_I_NEW_H_ 9 | #define BLOCK_KERNEL_I_NEW_H_ 10 | 11 | #include 12 | #include "sparse_defs.h" 13 | #include "../exception.h" 14 | 15 | namespace libtensor { 16 | 17 | template 18 | class block_kernel_i 19 | { 20 | public: 21 | void operator()(const std::vector& ptrs, const std::vector< dim_list >& dim_lists) 22 | { 23 | (*static_cast(this))(ptrs,dim_lists); 24 | } 25 | virtual ~block_kernel_i() {} 26 | }; 27 | } // namespace libtensor 28 | 29 | 30 | #endif /* BLOCK_KERNEL_I_NEW_H_ */ 31 | -------------------------------------------------------------------------------- /libtensor/block_sparse/gen_labeled_btensor.h: -------------------------------------------------------------------------------- 1 | #ifndef GEN_LABELED_BTENSOR_H 2 | #define GEN_LABELED_BTENSOR_H 3 | 4 | #include 5 | #include "batch_provider.h" 6 | 7 | namespace libtensor { 8 | 9 | template 10 | class gen_labeled_btensor { 11 | public: 12 | virtual expr::label get_letter_expr() const = 0; 13 | 14 | virtual sparse_bispace get_bispace() const = 0; 15 | 16 | virtual const T* get_data_ptr() const = 0; 17 | 18 | virtual batch_provider* get_batch_provider() const = 0; 19 | }; 20 | 21 | } // namespace libtensor 22 | 23 | #endif /* GEN_LABELED_BTENSOR_H */ 24 | -------------------------------------------------------------------------------- /libtensor/block_sparse/gen_sparse_btensor.h: -------------------------------------------------------------------------------- 1 | #ifndef GEN_SPARSE_BTENSOR_H 2 | #define GEN_SPARSE_BTENSOR_H 3 | 4 | #include "../expr/iface/any_tensor.h" 5 | #include "sparse_bispace.h" 6 | 7 | namespace libtensor { 8 | 9 | template 10 | class batch_provider_i; 11 | 12 | template 13 | class gen_sparse_btensor : public any_tensor 14 | { 15 | public: 16 | gen_sparse_btensor() : any_tensor(*this) {} 17 | virtual const sparse_bispace& get_bispace() const = 0; 18 | virtual const T* get_data_ptr() const = 0; 19 | virtual batch_provider_i* get_batch_provider() const = 0; 20 | }; 21 | 22 | } // namespace libtensor 23 | 24 | #endif /* GEN_SPARSE_BTENSOR_H */ 25 | -------------------------------------------------------------------------------- /libtensor/block_sparse/memory_reserve.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMORY_RESERVE_H 2 | #define MEMORY_RESERVE_H 3 | 4 | #include 5 | #include 6 | 7 | namespace libtensor { 8 | 9 | class memory_reserve 10 | { 11 | private: 12 | static const char *k_clazz; //!< Class name 13 | size_t m_mem_avail; 14 | size_t m_n_tensors; 15 | public: 16 | memory_reserve(size_t mem_total) : m_mem_avail(mem_total),m_n_tensors(0) {} 17 | size_t get_mem_avail() const; 18 | size_t get_n_tensors() const; 19 | void add_tensor(size_t mem); 20 | void remove_tensor(size_t mem); 21 | ~memory_reserve(); 22 | }; 23 | 24 | } // namespace libtensor 25 | 26 | #endif /* MEMORY_RESERVE_H */ 27 | -------------------------------------------------------------------------------- /libtensor/block_sparse/range.C: -------------------------------------------------------------------------------- 1 | /* 2 | * range.cpp 3 | * 4 | * Created on: Nov 15, 2013 5 | * Author: smanzer 6 | */ 7 | 8 | #include "range.h" 9 | 10 | namespace libtensor 11 | { 12 | 13 | block_list range(size_t min,size_t max) 14 | { 15 | block_list the_range; 16 | for(size_t i = min; i < max; ++i) 17 | { 18 | the_range.push_back(i); 19 | } 20 | return the_range; 21 | } 22 | 23 | } /* namespace libtensor */ 24 | -------------------------------------------------------------------------------- /libtensor/block_sparse/range.h: -------------------------------------------------------------------------------- 1 | /* 2 | * range.h 3 | * 4 | * Created on: Nov 15, 2013 5 | * Author: smanzer 6 | */ 7 | 8 | #ifndef RANGE_H_ 9 | #define RANGE_H_ 10 | 11 | #include 12 | #include "sparse_defs.h" 13 | 14 | namespace libtensor 15 | { 16 | 17 | block_list range(size_t min,size_t max); 18 | 19 | } /* namespace libtensor */ 20 | 21 | #endif /* RANGE_H_ */ 22 | -------------------------------------------------------------------------------- /libtensor/block_sparse/sparse_bispace_impl.C: -------------------------------------------------------------------------------- 1 | #include "sparse_bispace_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | const char* sparse_bispace_impl::k_clazz = "sparse_bispace_impl"; 6 | 7 | bool sparse_bispace_impl::operator==(const sparse_bispace_impl& rhs) const 8 | { 9 | return m_subspaces == rhs.m_subspaces; 10 | } 11 | 12 | } // namespace libtensor 13 | -------------------------------------------------------------------------------- /libtensor/block_sparse/subspace_iterator.h: -------------------------------------------------------------------------------- 1 | #ifndef SUBSPACE_ITERATOR_H 2 | #define SUBSPACE_ITERATOR_H 3 | 4 | #include "sparse_bispace.h" 5 | 6 | namespace libtensor { 7 | 8 | class subspace_iterator 9 | { 10 | size_t m_pos; 11 | block_list m_blocks; 12 | dim_list m_slice_sizes; 13 | public: 14 | subspace_iterator(const sparse_bispace_any_order& bispace,size_t subspace_idx); 15 | size_t get_block_index() const; 16 | size_t get_slice_size() const; 17 | subspace_iterator& operator++(); 18 | bool done() const; 19 | }; 20 | 21 | } // namespace libtensor 22 | 23 | 24 | 25 | #endif /* SUBSPACE_ITERATOR_H */ 26 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_add.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "btod_add_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_add< 1, btod_traits, btod_add<1> >; 8 | template class gen_bto_add< 2, btod_traits, btod_add<2> >; 9 | template class gen_bto_add< 3, btod_traits, btod_add<3> >; 10 | template class gen_bto_add< 4, btod_traits, btod_add<4> >; 11 | template class gen_bto_add< 5, btod_traits, btod_add<5> >; 12 | template class gen_bto_add< 6, btod_traits, btod_add<6> >; 13 | 14 | template class btod_add<1>; 15 | template class btod_add<2>; 16 | template class btod_add<3>; 17 | template class btod_add<4>; 18 | template class btod_add<5>; 19 | template class btod_add<6>; 20 | 21 | 22 | } // namespace libtensor 23 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_addition_schedule.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class addition_schedule<1, btod_traits>; 8 | template class addition_schedule<2, btod_traits>; 9 | template class addition_schedule<3, btod_traits>; 10 | template class addition_schedule<4, btod_traits>; 11 | template class addition_schedule<5, btod_traits>; 12 | template class addition_schedule<6, btod_traits>; 13 | template class addition_schedule<7, btod_traits>; 14 | template class addition_schedule<8, btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_aux_add.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_add<1, btod_traits>; 8 | template class gen_bto_aux_add<2, btod_traits>; 9 | template class gen_bto_aux_add<3, btod_traits>; 10 | template class gen_bto_aux_add<4, btod_traits>; 11 | template class gen_bto_aux_add<5, btod_traits>; 12 | template class gen_bto_aux_add<6, btod_traits>; 13 | template class gen_bto_aux_add<7, btod_traits>; 14 | template class gen_bto_aux_add<8, btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_aux_chsym.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_chsym<1, btod_traits>; 8 | template class gen_bto_aux_chsym<2, btod_traits>; 9 | template class gen_bto_aux_chsym<3, btod_traits>; 10 | template class gen_bto_aux_chsym<4, btod_traits>; 11 | template class gen_bto_aux_chsym<5, btod_traits>; 12 | template class gen_bto_aux_chsym<6, btod_traits>; 13 | template class gen_bto_aux_chsym<7, btod_traits>; 14 | template class gen_bto_aux_chsym<8, btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_aux_copy.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_copy<1, btod_traits>; 8 | template class gen_bto_aux_copy<2, btod_traits>; 9 | template class gen_bto_aux_copy<3, btod_traits>; 10 | template class gen_bto_aux_copy<4, btod_traits>; 11 | template class gen_bto_aux_copy<5, btod_traits>; 12 | template class gen_bto_aux_copy<6, btod_traits>; 13 | template class gen_bto_aux_copy<7, btod_traits>; 14 | template class gen_bto_aux_copy<8, btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_aux_symmetrize.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_symmetrize<1, btod_traits>; 8 | template class gen_bto_aux_symmetrize<2, btod_traits>; 9 | template class gen_bto_aux_symmetrize<3, btod_traits>; 10 | template class gen_bto_aux_symmetrize<4, btod_traits>; 11 | template class gen_bto_aux_symmetrize<5, btod_traits>; 12 | template class gen_bto_aux_symmetrize<6, btod_traits>; 13 | template class gen_bto_aux_symmetrize<7, btod_traits>; 14 | template class gen_bto_aux_symmetrize<8, btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_aux_transform.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_transform<1, btod_traits>; 8 | template class gen_bto_aux_transform<2, btod_traits>; 9 | template class gen_bto_aux_transform<3, btod_traits>; 10 | template class gen_bto_aux_transform<4, btod_traits>; 11 | template class gen_bto_aux_transform<5, btod_traits>; 12 | template class gen_bto_aux_transform<6, btod_traits>; 13 | template class gen_bto_aux_transform<7, btod_traits>; 14 | template class gen_bto_aux_transform<8, btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_compare.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "btod_compare_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_compare<1, btod_traits>; 8 | template class gen_bto_compare<2, btod_traits>; 9 | template class gen_bto_compare<3, btod_traits>; 10 | template class gen_bto_compare<4, btod_traits>; 11 | template class gen_bto_compare<5, btod_traits>; 12 | template class gen_bto_compare<6, btod_traits>; 13 | 14 | template class btod_compare<1>; 15 | template class btod_compare<2>; 16 | template class btod_compare<3>; 17 | template class btod_compare<4>; 18 | template class btod_compare<5>; 19 | template class btod_compare<6>; 20 | 21 | 22 | } // namespace libtensor 23 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_compare_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_COMPARE_IMPL_H 2 | #define LIBTENSOR_BTOD_COMPARE_IMPL_H 3 | 4 | #include // for fabs 5 | #include "../btod_compare.h" 6 | 7 | namespace libtensor { 8 | 9 | 10 | template 11 | const char *btod_compare::k_clazz = "btod_compare"; 12 | 13 | 14 | template 15 | btod_compare::btod_compare( 16 | block_tensor_rd_i &bt1, 17 | block_tensor_rd_i &bt2, 18 | double thresh, bool strict) : 19 | 20 | m_gbto(bt1, bt2, fabs(thresh), strict) { 21 | 22 | } 23 | 24 | 25 | template 26 | bool btod_compare::compare() { 27 | 28 | return m_gbto.compare(); 29 | } 30 | 31 | 32 | } // namespace libtensor 33 | 34 | #endif // LIBTENSOR_BTOD_COMPARE_IMPL_H 35 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_contract3.C: -------------------------------------------------------------------------------- 1 | #include "btod_contract3_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class btod_contract3<1, 0, 1, 1, 1>; 7 | template class btod_contract3<1, 1, 1, 1, 1>; 8 | template class btod_contract3<1, 1, 2, 0, 0>; 9 | template class btod_contract3<1, 1, 2, 1, 2>; 10 | template class btod_contract3<2, 0, 0, 0, 2>; 11 | template class btod_contract3<2, 0, 1, 1, 2>; 12 | template class btod_contract3<2, 0, 2, 1, 2>; 13 | 14 | 15 | } // namespace libtensor 16 | 17 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_export.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "btod_export_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class btod_export<1>; 8 | template class btod_export<2>; 9 | template class btod_export<3>; 10 | template class btod_export<4>; 11 | template class btod_export<5>; 12 | template class btod_export<6>; 13 | template class btod_export<7>; 14 | template class btod_export<8>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_random_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_RANDOM_IMPL_H 2 | #define LIBTENSOR_BTOD_RANDOM_IMPL_H 3 | 4 | #include "../btod_random.h" 5 | 6 | namespace libtensor { 7 | 8 | 9 | template 10 | const char *btod_random::k_clazz = "btod_random"; 11 | 12 | 13 | template 14 | void btod_random::perform(block_tensor_wr_i &bt) { 15 | 16 | m_gbto.perform(bt); 17 | } 18 | 19 | template 20 | void btod_random::perform(block_tensor_wr_i &bt, 21 | const index &idx) { 22 | 23 | m_gbto.perform(bt, idx); 24 | } 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_BTOD_RANDOM_IMPL_H 30 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_scale_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SCALE_IMPL_H 2 | #define LIBTENSOR_BTOD_SCALE_IMPL_H 3 | 4 | #include 5 | #include 6 | #include "../btod_scale.h" 7 | 8 | namespace libtensor { 9 | 10 | 11 | template 12 | const char btod_scale::k_clazz[] = "btod_scale"; 13 | 14 | 15 | } // namespace libtensor 16 | 17 | #endif // LIBTENSOR_BTOD_SCALE_IMPL_H 18 | 19 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_set_diag_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SET_DIAG_IMPL_H 2 | #define LIBTENSOR_BTOD_SET_DIAG_IMPL_H 3 | 4 | #include "../btod_set_diag.h" 5 | 6 | namespace libtensor { 7 | 8 | 9 | template 10 | const char *btod_set_diag::k_clazz = "btod_set_diag"; 11 | 12 | 13 | template 14 | btod_set_diag::btod_set_diag(const sequence &msk, double v) : 15 | m_gbto(msk, v) { 16 | 17 | } 18 | 19 | 20 | template 21 | btod_set_diag::btod_set_diag(double v) : m_gbto(sequence(1), v) { 22 | 23 | } 24 | 25 | 26 | template 27 | void btod_set_diag::perform(block_tensor_i &bt) { 28 | 29 | m_gbto.perform(bt); 30 | } 31 | 32 | 33 | } // namespace libtensor 34 | 35 | #endif // LIBTENSOR_BTOD_SET_DIAG_IMPL_H 36 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_set_elem_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SET_ELEM_IMPL_H 2 | #define LIBTENSOR_BTOD_SET_ELEM_IMPL_H 3 | 4 | #include "../btod_set_elem.h" 5 | 6 | namespace libtensor { 7 | 8 | 9 | template 10 | const char *btod_set_elem::k_clazz = "btod_set_elem"; 11 | 12 | 13 | template 14 | void btod_set_elem::perform(block_tensor_i &bt, 15 | const index &bidx, const index &idx, double d) { 16 | 17 | m_gbto.perform(bt, bidx, idx, d); 18 | } 19 | 20 | 21 | } // namespace libtensor 22 | 23 | #endif // LIBTENSOR_BTOD_SET_ELEM_IMPL_H 24 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_set_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SET_IMPL_H 2 | #define LIBTENSOR_BTOD_SET_IMPL_H 3 | 4 | #include "../btod_set.h" 5 | 6 | namespace libtensor { 7 | 8 | 9 | template 10 | const char btod_set::k_clazz[] = "btod_set"; 11 | 12 | 13 | } // namespace libtensor 14 | 15 | #endif // LIBTENSOR_BTOD_SET_IMPL_H 16 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_shift_diag_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SHIFT_DIAG_IMPL_H 2 | #define LIBTENSOR_BTOD_SHIFT_DIAG_IMPL_H 3 | 4 | #include "../btod_shift_diag.h" 5 | 6 | namespace libtensor { 7 | 8 | 9 | template 10 | const char *btod_shift_diag::k_clazz = "btod_shift_diag"; 11 | 12 | 13 | template 14 | btod_shift_diag::btod_shift_diag(const sequence &msk, double v) : 15 | m_gbto(msk, v) { 16 | 17 | } 18 | 19 | 20 | template 21 | void btod_shift_diag::perform(block_tensor_i &bt) { 22 | 23 | m_gbto.perform(bt); 24 | } 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_BTOD_SHIFT_DIAG_IMPL_H 30 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_size.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../btod_traits.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_size<1, btod_traits>; 8 | template class gen_bto_size<2, btod_traits>; 9 | template class gen_bto_size<3, btod_traits>; 10 | template class gen_bto_size<4, btod_traits>; 11 | template class gen_bto_size<5, btod_traits>; 12 | template class gen_bto_size<6, btod_traits>; 13 | template class gen_bto_size<7, btod_traits>; 14 | template class gen_bto_size<8, btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_symcontract3.C: -------------------------------------------------------------------------------- 1 | #include "btod_symcontract3_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class btod_symcontract3<1, 0, 1, 1, 1>; 7 | template class btod_symcontract3<1, 1, 1, 1, 1>; 8 | template class btod_symcontract3<2, 0, 2, 1, 2>; 9 | 10 | 11 | } // namespace libtensor 12 | 13 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_trace.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../btod_trace.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template 8 | const char *btod_trace::k_clazz = "btod_trace"; 9 | 10 | template class gen_bto_trace< 1, btod_traits, btod_trace<1> >; 11 | template class gen_bto_trace< 2, btod_traits, btod_trace<2> >; 12 | template class gen_bto_trace< 3, btod_traits, btod_trace<3> >; 13 | template class gen_bto_trace< 4, btod_traits, btod_trace<4> >; 14 | 15 | template class btod_trace<1>; 16 | template class btod_trace<2>; 17 | template class btod_trace<3>; 18 | template class btod_trace<4>; 19 | 20 | 21 | } // namespace libtensor 22 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_unfold_block_list.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../btod_traits.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_unfold_block_list< 1, btod_traits >; 8 | template class gen_bto_unfold_block_list< 2, btod_traits >; 9 | template class gen_bto_unfold_block_list< 3, btod_traits >; 10 | template class gen_bto_unfold_block_list< 4, btod_traits >; 11 | template class gen_bto_unfold_block_list< 5, btod_traits >; 12 | template class gen_bto_unfold_block_list< 6, btod_traits >; 13 | template class gen_bto_unfold_block_list< 7, btod_traits >; 14 | template class gen_bto_unfold_block_list< 8, btod_traits >; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/block_tensor/impl/btod_unfold_symmetry.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../btod_traits.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_unfold_symmetry< 1, btod_traits >; 8 | template class gen_bto_unfold_symmetry< 2, btod_traits >; 9 | template class gen_bto_unfold_symmetry< 3, btod_traits >; 10 | template class gen_bto_unfold_symmetry< 4, btod_traits >; 11 | template class gen_bto_unfold_symmetry< 5, btod_traits >; 12 | template class gen_bto_unfold_symmetry< 6, btod_traits >; 13 | template class gen_bto_unfold_symmetry< 7, btod_traits >; 14 | template class gen_bto_unfold_symmetry< 8, btod_traits >; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/core/impl/abs_index.C: -------------------------------------------------------------------------------- 1 | #include "abs_index_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class abs_index<0>; 7 | template class abs_index<1>; 8 | template class abs_index<2>; 9 | template class abs_index<3>; 10 | template class abs_index<4>; 11 | template class abs_index<5>; 12 | template class abs_index<6>; 13 | template class abs_index<7>; 14 | template class abs_index<8>; 15 | template class abs_index<9>; 16 | template class abs_index<10>; 17 | template class abs_index<11>; 18 | template class abs_index<12>; 19 | template class abs_index<13>; 20 | template class abs_index<14>; 21 | template class abs_index<15>; 22 | template class abs_index<16>; 23 | 24 | 25 | } // namespace libtensor 26 | -------------------------------------------------------------------------------- /libtensor/core/impl/allocator.C: -------------------------------------------------------------------------------- 1 | #include "allocator_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class allocator; 7 | template class allocator; 8 | 9 | 10 | } // namespace libtensor 11 | -------------------------------------------------------------------------------- /libtensor/core/impl/batching_policy_base.C: -------------------------------------------------------------------------------- 1 | #include "../batching_policy_base.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | batching_policy_base::batching_policy_base() : m_batchsz(0) { 7 | 8 | } 9 | 10 | 11 | void batching_policy_base::set_batch_size(size_t batchsz) { 12 | 13 | batching_policy_base::get_instance().m_batchsz = batchsz; 14 | } 15 | 16 | 17 | size_t batching_policy_base::get_batch_size() { 18 | 19 | return batching_policy_base::get_instance().m_batchsz; 20 | } 21 | 22 | 23 | } // namespace libtensor 24 | 25 | -------------------------------------------------------------------------------- /libtensor/core/impl/combined_orbits.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "combined_orbits_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class combined_orbits<1, double>; 8 | template class combined_orbits<2, double>; 9 | template class combined_orbits<3, double>; 10 | template class combined_orbits<4, double>; 11 | template class combined_orbits<5, double>; 12 | template class combined_orbits<6, double>; 13 | template class combined_orbits<7, double>; 14 | template class combined_orbits<8, double>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/core/impl/dimensions.C: -------------------------------------------------------------------------------- 1 | #include "dimensions_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | const char *dimensions<0>::k_clazz = "dimensions<0>"; 7 | 8 | 9 | template class dimensions<1>; 10 | template class dimensions<2>; 11 | template class dimensions<3>; 12 | template class dimensions<4>; 13 | template class dimensions<5>; 14 | template class dimensions<6>; 15 | template class dimensions<7>; 16 | template class dimensions<8>; 17 | template class dimensions<9>; 18 | template class dimensions<10>; 19 | template class dimensions<11>; 20 | template class dimensions<12>; 21 | template class dimensions<13>; 22 | template class dimensions<14>; 23 | template class dimensions<15>; 24 | template class dimensions<16>; 25 | 26 | 27 | } // namespace libtensor 28 | -------------------------------------------------------------------------------- /libtensor/core/impl/magic_dimensions.C: -------------------------------------------------------------------------------- 1 | #include "magic_dimensions_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class magic_dimensions<1>; 7 | template class magic_dimensions<2>; 8 | template class magic_dimensions<3>; 9 | template class magic_dimensions<4>; 10 | template class magic_dimensions<5>; 11 | template class magic_dimensions<6>; 12 | template class magic_dimensions<7>; 13 | template class magic_dimensions<8>; 14 | template class magic_dimensions<9>; 15 | template class magic_dimensions<10>; 16 | template class magic_dimensions<11>; 17 | template class magic_dimensions<12>; 18 | template class magic_dimensions<13>; 19 | template class magic_dimensions<14>; 20 | template class magic_dimensions<15>; 21 | template class magic_dimensions<16>; 22 | 23 | 24 | } // namespace libtensor 25 | -------------------------------------------------------------------------------- /libtensor/core/impl/orbit.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "orbit_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class orbit<1, double>; 8 | template class orbit<2, double>; 9 | template class orbit<3, double>; 10 | template class orbit<4, double>; 11 | template class orbit<5, double>; 12 | template class orbit<6, double>; 13 | template class orbit<7, double>; 14 | template class orbit<8, double>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/core/impl/orbit_list.C: -------------------------------------------------------------------------------- 1 | #include "orbit_list_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class orbit_list<1, double>; 7 | template class orbit_list<2, double>; 8 | template class orbit_list<3, double>; 9 | template class orbit_list<4, double>; 10 | template class orbit_list<5, double>; 11 | template class orbit_list<6, double>; 12 | template class orbit_list<7, double>; 13 | template class orbit_list<8, double>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/core/impl/subgroup_orbits.C: -------------------------------------------------------------------------------- 1 | #include "subgroup_orbits_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class subgroup_orbits<1, double>; 7 | template class subgroup_orbits<2, double>; 8 | template class subgroup_orbits<3, double>; 9 | template class subgroup_orbits<4, double>; 10 | template class subgroup_orbits<5, double>; 11 | template class subgroup_orbits<6, double>; 12 | template class subgroup_orbits<7, double>; 13 | template class subgroup_orbits<8, double>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/core/print_dimensions.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_PRINT_DIMENSIONS_H 2 | #define LIBTENSOR_PRINT_DIMENSIONS_H 3 | 4 | #include 5 | #include "dimensions.h" 6 | 7 | namespace libtensor { 8 | 9 | 10 | template 11 | std::ostream &operator<<(std::ostream &os, const dimensions &d) { 12 | 13 | os << "["; 14 | for(size_t j = 0; j < N; j++) os << d[j] << (j + 1 == N ? "" : ", "); 15 | os << "]"; 16 | return os; 17 | } 18 | 19 | 20 | } // namespace libtensor 21 | 22 | #endif // LIBTENSOR_PRINT_DIMENSIONS_H 23 | -------------------------------------------------------------------------------- /libtensor/core/tensor_transf_double.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_TENSOR_TRANSF_DOUBLE_H 2 | #define LIBTENSOR_TENSOR_TRANSF_DOUBLE_H 3 | 4 | #include "scalar_transf_double.h" 5 | #include "tensor_transf.h" 6 | 7 | #endif // LIBTENSOR_TENSOR_TRANSF_DOUBLE_H 8 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/ctf_symmetry_builder.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_SYMMETRY_BUILDER_H 2 | #define LIBTENSOR_CTF_SYMMETRY_BUILDER_H 3 | 4 | #include 5 | #include 6 | 7 | namespace libtensor { 8 | 9 | 10 | template 11 | class ctf_symmetry_builder { 12 | private: 13 | ctf_symmetry m_sym; 14 | 15 | public: 16 | ctf_symmetry_builder(const transf_list &trl) : 17 | m_sym(build(trl)) 18 | { } 19 | 20 | const ctf_symmetry &get_symmetry() const { 21 | return m_sym; 22 | } 23 | 24 | private: 25 | static ctf_symmetry build(const transf_list &trl); 26 | 27 | }; 28 | 29 | 30 | } // namespace libtensor 31 | 32 | #endif // LIBTENSOR_CTF_SYMMETRY_BUILDER_H 33 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_addition_schedule.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace libtensor { 6 | 7 | 8 | template class addition_schedule<1, ctf_btod_traits>; 9 | template class addition_schedule<2, ctf_btod_traits>; 10 | template class addition_schedule<3, ctf_btod_traits>; 11 | template class addition_schedule<4, ctf_btod_traits>; 12 | template class addition_schedule<5, ctf_btod_traits>; 13 | template class addition_schedule<6, ctf_btod_traits>; 14 | template class addition_schedule<7, ctf_btod_traits>; 15 | template class addition_schedule<8, ctf_btod_traits>; 16 | 17 | 18 | } // namespace libtensor 19 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_aux_add.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | template class gen_bto_aux_add<1, ctf_btod_traits>; 10 | template class gen_bto_aux_add<2, ctf_btod_traits>; 11 | template class gen_bto_aux_add<3, ctf_btod_traits>; 12 | template class gen_bto_aux_add<4, ctf_btod_traits>; 13 | template class gen_bto_aux_add<5, ctf_btod_traits>; 14 | template class gen_bto_aux_add<6, ctf_btod_traits>; 15 | template class gen_bto_aux_add<7, ctf_btod_traits>; 16 | template class gen_bto_aux_add<8, ctf_btod_traits>; 17 | 18 | 19 | } // namespace libtensor 20 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_aux_chsym.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../ctf_btod_traits.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_chsym<1, ctf_btod_traits>; 8 | template class gen_bto_aux_chsym<2, ctf_btod_traits>; 9 | template class gen_bto_aux_chsym<3, ctf_btod_traits>; 10 | template class gen_bto_aux_chsym<4, ctf_btod_traits>; 11 | template class gen_bto_aux_chsym<5, ctf_btod_traits>; 12 | template class gen_bto_aux_chsym<6, ctf_btod_traits>; 13 | template class gen_bto_aux_chsym<7, ctf_btod_traits>; 14 | template class gen_bto_aux_chsym<8, ctf_btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_aux_symmetrize.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../ctf_btod_traits.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_symmetrize<1, ctf_btod_traits>; 8 | template class gen_bto_aux_symmetrize<2, ctf_btod_traits>; 9 | template class gen_bto_aux_symmetrize<3, ctf_btod_traits>; 10 | template class gen_bto_aux_symmetrize<4, ctf_btod_traits>; 11 | template class gen_bto_aux_symmetrize<5, ctf_btod_traits>; 12 | template class gen_bto_aux_symmetrize<6, ctf_btod_traits>; 13 | template class gen_bto_aux_symmetrize<7, ctf_btod_traits>; 14 | template class gen_bto_aux_symmetrize<8, ctf_btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_aux_transform.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../ctf_btod_traits.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_transform<1, ctf_btod_traits>; 8 | template class gen_bto_aux_transform<2, ctf_btod_traits>; 9 | template class gen_bto_aux_transform<3, ctf_btod_traits>; 10 | template class gen_bto_aux_transform<4, ctf_btod_traits>; 11 | template class gen_bto_aux_transform<5, ctf_btod_traits>; 12 | template class gen_bto_aux_transform<6, ctf_btod_traits>; 13 | template class gen_bto_aux_transform<7, ctf_btod_traits>; 14 | template class gen_bto_aux_transform<8, ctf_btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_collect.C: -------------------------------------------------------------------------------- 1 | #include "ctf_btod_collect_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_btod_collect<1>; 7 | template class ctf_btod_collect<2>; 8 | template class ctf_btod_collect<3>; 9 | template class ctf_btod_collect<4>; 10 | template class ctf_btod_collect<5>; 11 | template class ctf_btod_collect<6>; 12 | template class ctf_btod_collect<7>; 13 | template class ctf_btod_collect<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_distribute.C: -------------------------------------------------------------------------------- 1 | #include "ctf_btod_distribute_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_btod_distribute<1>; 7 | template class ctf_btod_distribute<2>; 8 | template class ctf_btod_distribute<3>; 9 | template class ctf_btod_distribute<4>; 10 | template class ctf_btod_distribute<5>; 11 | template class ctf_btod_distribute<6>; 12 | template class ctf_btod_distribute<7>; 13 | template class ctf_btod_distribute<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_mult1_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_MULT1_IMPL_H 2 | #define LIBTENSOR_CTF_BTOD_MULT1_IMPL_H 3 | 4 | #include 5 | #include "../ctf_btod_mult1.h" 6 | 7 | namespace libtensor { 8 | 9 | 10 | template 11 | const char ctf_btod_mult1::k_clazz[] = "ctf_btod_mult1"; 12 | 13 | 14 | } // namespace libtensor 15 | 16 | #endif // LIBTENSOR_CTF_BTOD_MULT1_IMPL_H 17 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_scale_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_SCALE_IMPL_H 2 | #define LIBTENSOR_CTF_BTOD_SCALE_IMPL_H 3 | 4 | #include 5 | #include 6 | #include "../ctf_btod_scale.h" 7 | 8 | namespace libtensor { 9 | 10 | 11 | template 12 | const char ctf_btod_scale::k_clazz[] = "ctf_btod_scale"; 13 | 14 | 15 | } // namespace libtensor 16 | 17 | #endif // LIBTENSOR_CTF_BTOD_SCALE_IMPL_H 18 | 19 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_set_symmetry.C: -------------------------------------------------------------------------------- 1 | #include "ctf_btod_set_symmetry_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_btod_set_symmetry<1>; 7 | template class ctf_btod_set_symmetry<2>; 8 | template class ctf_btod_set_symmetry<3>; 9 | template class ctf_btod_set_symmetry<4>; 10 | template class ctf_btod_set_symmetry<5>; 11 | template class ctf_btod_set_symmetry<6>; 12 | template class ctf_btod_set_symmetry<7>; 13 | template class ctf_btod_set_symmetry<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_trace.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ctf_btod_trace_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_trace< 1, ctf_btod_traits, ctf_btod_trace<1> >; 8 | template class gen_bto_trace< 2, ctf_btod_traits, ctf_btod_trace<2> >; 9 | template class gen_bto_trace< 3, ctf_btod_traits, ctf_btod_trace<3> >; 10 | template class gen_bto_trace< 4, ctf_btod_traits, ctf_btod_trace<4> >; 11 | 12 | template class ctf_btod_trace<1>; 13 | template class ctf_btod_trace<2>; 14 | template class ctf_btod_trace<3>; 15 | template class ctf_btod_trace<4>; 16 | 17 | 18 | } // namespace libtensor 19 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_btod_trace_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_TRACE_IMPL_H 2 | #define LIBTENSOR_CTF_BTOD_TRACE_IMPL_H 3 | 4 | #include 5 | #include "../ctf_btod_trace.h" 6 | 7 | namespace libtensor { 8 | 9 | 10 | template 11 | const char ctf_btod_trace::k_clazz[] = "ctf_btod_trace"; 12 | 13 | 14 | } // namespace libtensor 15 | 16 | #endif // LIBTENSOR_CTF_BTOD_TRACE_IMPL_H 17 | 18 | -------------------------------------------------------------------------------- /libtensor/ctf_block_tensor/impl/ctf_symmetry_builder.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ctf_symmetry_builder_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class ctf_symmetry_builder<1, double>; 8 | template class ctf_symmetry_builder<2, double>; 9 | template class ctf_symmetry_builder<3, double>; 10 | template class ctf_symmetry_builder<4, double>; 11 | template class ctf_symmetry_builder<5, double>; 12 | template class ctf_symmetry_builder<6, double>; 13 | template class ctf_symmetry_builder<7, double>; 14 | template class ctf_symmetry_builder<8, double>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/ctf_btensor.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTENSOR_H 2 | #define LIBTENSOR_CTF_BTENSOR_H 3 | 4 | #if defined(WITH_CTF) 5 | 6 | #define WITH_CTF_BTENSOR 7 | #include "ctf_dense_tensor/ctf.h" 8 | #include "ctf_block_tensor/ctf_btod_collect.h" 9 | #include "ctf_block_tensor/ctf_btod_distribute.h" 10 | #include "expr/ctf_btensor/ctf_btensor.h" 11 | 12 | #endif 13 | 14 | #endif // LIBTENSOR_CTF_BTENSOR_H 15 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/ctf.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_H 2 | #define LIBTENSOR_CTF_H 3 | 4 | namespace libtensor { 5 | 6 | 7 | class ctf { 8 | public: 9 | static void init(); 10 | static void exit(); 11 | static unsigned get_rank(); 12 | static unsigned get_size(); 13 | static bool is_master(); 14 | static unsigned ctf_version(); 15 | 16 | }; 17 | 18 | 19 | } // namespace libtensor 20 | 21 | #endif // LIBTENSOR_CTF_H 22 | 23 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf.C: -------------------------------------------------------------------------------- 1 | #include "../ctf.h" 2 | #include "ctf_world.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | void ctf::init() { 8 | ctf_world::init(); 9 | } 10 | 11 | 12 | void ctf::exit() { 13 | ctf_world::exit(); 14 | } 15 | 16 | 17 | unsigned ctf::get_rank() { 18 | return ctf_world::get_rank(); 19 | } 20 | 21 | 22 | unsigned ctf::get_size() { 23 | return ctf_world::get_size(); 24 | } 25 | 26 | 27 | bool ctf::is_master() { 28 | return ctf_world::is_master(); 29 | } 30 | 31 | 32 | unsigned ctf::ctf_version() { 33 | return CTF_VERSION; 34 | } 35 | 36 | 37 | } // namespace libtensor 38 | 39 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_dense_tensor.C: -------------------------------------------------------------------------------- 1 | #include "ctf_dense_tensor_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_dense_tensor<1, double>; 7 | template class ctf_dense_tensor<2, double>; 8 | template class ctf_dense_tensor<3, double>; 9 | template class ctf_dense_tensor<4, double>; 10 | template class ctf_dense_tensor<5, double>; 11 | template class ctf_dense_tensor<6, double>; 12 | template class ctf_dense_tensor<7, double>; 13 | template class ctf_dense_tensor<8, double>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_fctr.C: -------------------------------------------------------------------------------- 1 | #include "ctf_fctr.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | double ctf_fctr_ddiv(double a, double b) { 7 | 8 | return a / b; 9 | } 10 | 11 | 12 | } // namespace libtensor 13 | 14 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_fctr.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_FCTR_H 2 | #define LIBTENSOR_CTF_FCTR_H 3 | 4 | namespace libtensor { 5 | 6 | 7 | /** \brief Element-wise division (c = a / b) 8 | 9 | \ingroup libtensor_ctf_dense_tensor 10 | **/ 11 | double ctf_fctr_ddiv(double a, double b); 12 | 13 | 14 | } // namespace libtensor 15 | 16 | #endif // LIBTENSOR_CTF_FCTR_H 17 | 18 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_symmetry.C: -------------------------------------------------------------------------------- 1 | #include "ctf_symmetry_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_symmetry<1, double>; 7 | template class ctf_symmetry<2, double>; 8 | template class ctf_symmetry<3, double>; 9 | template class ctf_symmetry<4, double>; 10 | template class ctf_symmetry<5, double>; 11 | template class ctf_symmetry<6, double>; 12 | template class ctf_symmetry<7, double>; 13 | template class ctf_symmetry<8, double>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_collect.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_collect_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_collect<1>; 7 | template class ctf_tod_collect<2>; 8 | template class ctf_tod_collect<3>; 9 | template class ctf_tod_collect<4>; 10 | template class ctf_tod_collect<5>; 11 | template class ctf_tod_collect<6>; 12 | template class ctf_tod_collect<7>; 13 | template class ctf_tod_collect<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_copy.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_copy_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_copy<1>; 7 | template class ctf_tod_copy<2>; 8 | template class ctf_tod_copy<3>; 9 | template class ctf_tod_copy<4>; 10 | template class ctf_tod_copy<5>; 11 | template class ctf_tod_copy<6>; 12 | template class ctf_tod_copy<7>; 13 | template class ctf_tod_copy<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_distribute.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_distribute_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_distribute<1>; 7 | template class ctf_tod_distribute<2>; 8 | template class ctf_tod_distribute<3>; 9 | template class ctf_tod_distribute<4>; 10 | template class ctf_tod_distribute<5>; 11 | template class ctf_tod_distribute<6>; 12 | template class ctf_tod_distribute<7>; 13 | template class ctf_tod_distribute<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_dotprod.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_dotprod_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_dotprod<1>; 7 | template class ctf_tod_dotprod<2>; 8 | template class ctf_tod_dotprod<3>; 9 | template class ctf_tod_dotprod<4>; 10 | template class ctf_tod_dotprod<5>; 11 | template class ctf_tod_dotprod<6>; 12 | template class ctf_tod_dotprod<7>; 13 | template class ctf_tod_dotprod<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_mult.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_mult_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_mult<1>; 7 | template class ctf_tod_mult<2>; 8 | template class ctf_tod_mult<3>; 9 | template class ctf_tod_mult<4>; 10 | template class ctf_tod_mult<5>; 11 | template class ctf_tod_mult<6>; 12 | template class ctf_tod_mult<7>; 13 | template class ctf_tod_mult<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_mult1.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_mult1_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_mult1<1>; 7 | template class ctf_tod_mult1<2>; 8 | template class ctf_tod_mult1<3>; 9 | template class ctf_tod_mult1<4>; 10 | template class ctf_tod_mult1<5>; 11 | template class ctf_tod_mult1<6>; 12 | template class ctf_tod_mult1<7>; 13 | template class ctf_tod_mult1<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_random.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_random_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_random<1>; 7 | template class ctf_tod_random<2>; 8 | template class ctf_tod_random<3>; 9 | template class ctf_tod_random<4>; 10 | template class ctf_tod_random<5>; 11 | template class ctf_tod_random<6>; 12 | template class ctf_tod_random<7>; 13 | template class ctf_tod_random<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_scale.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_scale_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_scale<1>; 7 | template class ctf_tod_scale<2>; 8 | template class ctf_tod_scale<3>; 9 | template class ctf_tod_scale<4>; 10 | template class ctf_tod_scale<5>; 11 | template class ctf_tod_scale<6>; 12 | template class ctf_tod_scale<7>; 13 | template class ctf_tod_scale<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_set.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_set_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_set<1>; 7 | template class ctf_tod_set<2>; 8 | template class ctf_tod_set<3>; 9 | template class ctf_tod_set<4>; 10 | template class ctf_tod_set<5>; 11 | template class ctf_tod_set<6>; 12 | template class ctf_tod_set<7>; 13 | template class ctf_tod_set<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_set_diag.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_set_diag_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_set_diag<1>; 7 | template class ctf_tod_set_diag<2>; 8 | template class ctf_tod_set_diag<3>; 9 | template class ctf_tod_set_diag<4>; 10 | template class ctf_tod_set_diag<5>; 11 | template class ctf_tod_set_diag<6>; 12 | template class ctf_tod_set_diag<7>; 13 | template class ctf_tod_set_diag<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_set_symmetry.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_set_symmetry_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_set_symmetry<1>; 7 | template class ctf_tod_set_symmetry<2>; 8 | template class ctf_tod_set_symmetry<3>; 9 | template class ctf_tod_set_symmetry<4>; 10 | template class ctf_tod_set_symmetry<5>; 11 | template class ctf_tod_set_symmetry<6>; 12 | template class ctf_tod_set_symmetry<7>; 13 | template class ctf_tod_set_symmetry<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_set_symmetry_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_SET_SYMMETRY_IMPL_H 2 | #define LIBTENSOR_CTF_TOD_SET_SYMMETRY_IMPL_H 3 | 4 | #include "../ctf_dense_tensor_ctrl.h" 5 | #include "../ctf_tod_set_symmetry.h" 6 | 7 | namespace libtensor { 8 | 9 | 10 | template 11 | const char ctf_tod_set_symmetry::k_clazz[] = "ctf_tod_set_symmetry"; 12 | 13 | 14 | template 15 | void ctf_tod_set_symmetry::perform(bool zero, 16 | ctf_dense_tensor_i &ta) { 17 | 18 | ctf_dense_tensor_ctrl ca(ta); 19 | if(zero) { 20 | ca.reset_symmetry(m_sym); 21 | } else { 22 | ca.adjust_symmetry(m_sym); 23 | } 24 | } 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_CTF_TOD_SET_SYMMETRY_IMPL_H 30 | -------------------------------------------------------------------------------- /libtensor/ctf_dense_tensor/impl/ctf_tod_trace.C: -------------------------------------------------------------------------------- 1 | #include "ctf_tod_trace_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class ctf_tod_trace<1>; 7 | template class ctf_tod_trace<2>; 8 | template class ctf_tod_trace<3>; 9 | template class ctf_tod_trace<4>; 10 | template class ctf_tod_trace<5>; 11 | template class ctf_tod_trace<6>; 12 | template class ctf_tod_trace<7>; 13 | template class ctf_tod_trace<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/defs.C: -------------------------------------------------------------------------------- 1 | #include "defs.h" 2 | 3 | namespace libtensor { 4 | 5 | const char *g_ns = "libtensor"; 6 | 7 | namespace labeled_btensor_expr { 8 | 9 | const char *g_ns = "libtensor::labeled_btensor_expr"; 10 | 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/dense_tensor.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "dense_tensor_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class dense_tensor< 0, double, allocator >; 8 | template class dense_tensor< 1, double, allocator >; 9 | template class dense_tensor< 2, double, allocator >; 10 | template class dense_tensor< 3, double, allocator >; 11 | template class dense_tensor< 4, double, allocator >; 12 | template class dense_tensor< 5, double, allocator >; 13 | template class dense_tensor< 6, double, allocator >; 14 | template class dense_tensor< 7, double, allocator >; 15 | template class dense_tensor< 8, double, allocator >; 16 | 17 | 18 | } // namespace libtensor 19 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_add.C: -------------------------------------------------------------------------------- 1 | #include "tod_add_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_add<1>; 7 | template class tod_add<2>; 8 | template class tod_add<3>; 9 | template class tod_add<4>; 10 | template class tod_add<5>; 11 | template class tod_add<6>; 12 | template class tod_add<7>; 13 | template class tod_add<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_btconv.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "tod_btconv_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class tod_btconv<1>; 8 | template class tod_btconv<2>; 9 | template class tod_btconv<3>; 10 | template class tod_btconv<4>; 11 | template class tod_btconv<5>; 12 | template class tod_btconv<6>; 13 | template class tod_btconv<7>; 14 | template class tod_btconv<8>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_compare.C: -------------------------------------------------------------------------------- 1 | #include "tod_compare_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_compare<0>; 7 | template class tod_compare<1>; 8 | template class tod_compare<2>; 9 | template class tod_compare<3>; 10 | template class tod_compare<4>; 11 | template class tod_compare<5>; 12 | template class tod_compare<6>; 13 | template class tod_compare<7>; 14 | template class tod_compare<8>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_contract2_1.C: -------------------------------------------------------------------------------- 1 | #include "tod_contract2_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_contract2<0, 1, 1>; 7 | template class tod_contract2<0, 1, 2>; 8 | template class tod_contract2<0, 1, 3>; 9 | template class tod_contract2<0, 1, 4>; 10 | template class tod_contract2<0, 1, 5>; 11 | template class tod_contract2<0, 1, 6>; 12 | template class tod_contract2<0, 1, 7>; 13 | template class tod_contract2<1, 0, 1>; 14 | template class tod_contract2<1, 0, 2>; 15 | template class tod_contract2<1, 0, 3>; 16 | template class tod_contract2<1, 0, 4>; 17 | template class tod_contract2<1, 0, 5>; 18 | template class tod_contract2<1, 0, 6>; 19 | template class tod_contract2<1, 0, 7>; 20 | 21 | 22 | } // namespace libtensor 23 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_copy.C: -------------------------------------------------------------------------------- 1 | #include "tod_copy_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_copy<1>; 7 | template class tod_copy<2>; 8 | template class tod_copy<3>; 9 | template class tod_copy<4>; 10 | template class tod_copy<5>; 11 | template class tod_copy<6>; 12 | template class tod_copy<7>; 13 | template class tod_copy<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_copy_wnd.C: -------------------------------------------------------------------------------- 1 | #include "tod_copy_wnd_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_copy_wnd<1>; 7 | template class tod_copy_wnd<2>; 8 | template class tod_copy_wnd<3>; 9 | template class tod_copy_wnd<4>; 10 | template class tod_copy_wnd<5>; 11 | template class tod_copy_wnd<6>; 12 | template class tod_copy_wnd<7>; 13 | template class tod_copy_wnd<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_dotprod.C: -------------------------------------------------------------------------------- 1 | #include "tod_dotprod_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_dotprod<1>; 7 | template class tod_dotprod<2>; 8 | template class tod_dotprod<3>; 9 | template class tod_dotprod<4>; 10 | template class tod_dotprod<5>; 11 | template class tod_dotprod<6>; 12 | template class tod_dotprod<7>; 13 | template class tod_dotprod<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_import_raw.C: -------------------------------------------------------------------------------- 1 | #include "tod_import_raw_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_import_raw<1>; 7 | template class tod_import_raw<2>; 8 | template class tod_import_raw<3>; 9 | template class tod_import_raw<4>; 10 | template class tod_import_raw<5>; 11 | template class tod_import_raw<6>; 12 | template class tod_import_raw<7>; 13 | template class tod_import_raw<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_import_raw_stream.C: -------------------------------------------------------------------------------- 1 | #include "tod_import_raw_stream_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_import_raw_stream<1>; 7 | template class tod_import_raw_stream<2>; 8 | template class tod_import_raw_stream<3>; 9 | template class tod_import_raw_stream<4>; 10 | template class tod_import_raw_stream<5>; 11 | template class tod_import_raw_stream<6>; 12 | template class tod_import_raw_stream<7>; 13 | template class tod_import_raw_stream<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_mult.C: -------------------------------------------------------------------------------- 1 | #include "tod_mult_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_mult<1>; 7 | template class tod_mult<2>; 8 | template class tod_mult<3>; 9 | template class tod_mult<4>; 10 | template class tod_mult<5>; 11 | template class tod_mult<6>; 12 | template class tod_mult<7>; 13 | template class tod_mult<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_mult1.C: -------------------------------------------------------------------------------- 1 | #include "tod_mult1_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_mult1<1>; 7 | template class tod_mult1<2>; 8 | template class tod_mult1<3>; 9 | template class tod_mult1<4>; 10 | template class tod_mult1<5>; 11 | template class tod_mult1<6>; 12 | template class tod_mult1<7>; 13 | template class tod_mult1<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_random.C: -------------------------------------------------------------------------------- 1 | #include "tod_random_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_random<1>; 7 | template class tod_random<2>; 8 | template class tod_random<3>; 9 | template class tod_random<4>; 10 | template class tod_random<5>; 11 | template class tod_random<6>; 12 | template class tod_random<7>; 13 | template class tod_random<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_scale.C: -------------------------------------------------------------------------------- 1 | #include "tod_scale_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_scale<1>; 7 | template class tod_scale<2>; 8 | template class tod_scale<3>; 9 | template class tod_scale<4>; 10 | template class tod_scale<5>; 11 | template class tod_scale<6>; 12 | template class tod_scale<7>; 13 | template class tod_scale<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_screen.C: -------------------------------------------------------------------------------- 1 | #include "tod_screen_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_screen<1>; 7 | template class tod_screen<2>; 8 | template class tod_screen<3>; 9 | template class tod_screen<4>; 10 | template class tod_screen<5>; 11 | template class tod_screen<6>; 12 | template class tod_screen<7>; 13 | template class tod_screen<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_set.C: -------------------------------------------------------------------------------- 1 | #include "tod_set_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_set<1>; 7 | template class tod_set<2>; 8 | template class tod_set<3>; 9 | template class tod_set<4>; 10 | template class tod_set<5>; 11 | template class tod_set<6>; 12 | template class tod_set<7>; 13 | template class tod_set<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_set_diag.C: -------------------------------------------------------------------------------- 1 | #include "tod_set_diag_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_set_diag<1>; 7 | template class tod_set_diag<2>; 8 | template class tod_set_diag<3>; 9 | template class tod_set_diag<4>; 10 | template class tod_set_diag<5>; 11 | template class tod_set_diag<6>; 12 | template class tod_set_diag<7>; 13 | template class tod_set_diag<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_set_elem.C: -------------------------------------------------------------------------------- 1 | #include "tod_set_elem_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_set_elem<1>; 7 | template class tod_set_elem<2>; 8 | template class tod_set_elem<3>; 9 | template class tod_set_elem<4>; 10 | template class tod_set_elem<5>; 11 | template class tod_set_elem<6>; 12 | template class tod_set_elem<7>; 13 | template class tod_set_elem<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_set_elem_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_TOD_SET_ELEM_IMPL_H 2 | #define LIBTENSOR_TOD_SET_ELEM_IMPL_H 3 | 4 | #include 5 | #include "../dense_tensor_ctrl.h" 6 | #include "../tod_set_elem.h" 7 | 8 | namespace libtensor { 9 | 10 | 11 | template 12 | void tod_set_elem::perform(dense_tensor_wr_i &t, 13 | const index &idx, double d) { 14 | 15 | dense_tensor_wr_ctrl ctrl(t); 16 | double *p = ctrl.req_dataptr(); 17 | p[abs_index(idx, t.get_dims()).get_abs_index()] = d; 18 | ctrl.ret_dataptr(p); 19 | } 20 | 21 | 22 | } // namespace libtensor 23 | 24 | #endif // LIBTENSOR_TOD_SET_ELEM_IMPL_H 25 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_size.C: -------------------------------------------------------------------------------- 1 | #include "tod_size_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_size<1>; 7 | template class tod_size<2>; 8 | template class tod_size<3>; 9 | template class tod_size<4>; 10 | template class tod_size<5>; 11 | template class tod_size<6>; 12 | template class tod_size<7>; 13 | template class tod_size<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_size_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_TOD_SIZE_IMPL_H 2 | #define LIBTENSOR_TOD_SIZE_IMPL_H 3 | 4 | #include 5 | #include "../tod_size.h" 6 | 7 | namespace libtensor { 8 | 9 | 10 | template 11 | size_t tod_size::get_size(dense_tensor_rd_i &t) { 12 | 13 | size_t n = t.get_dims().get_size(); 14 | return allocator::get_block_size(n); 15 | } 16 | 17 | 18 | } // namespace libtensor 19 | 20 | #endif // LIBTENSOR_TOD_SIZE_IMPL_H 21 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_trace.C: -------------------------------------------------------------------------------- 1 | #include "tod_trace_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_trace<1>; 7 | template class tod_trace<2>; 8 | template class tod_trace<3>; 9 | template class tod_trace<4>; 10 | template class tod_trace<5>; 11 | template class tod_trace<6>; 12 | template class tod_trace<7>; 13 | template class tod_trace<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_vmpriority.C: -------------------------------------------------------------------------------- 1 | #include "tod_vmpriority_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_vmpriority<1>; 7 | template class tod_vmpriority<2>; 8 | template class tod_vmpriority<3>; 9 | template class tod_vmpriority<4>; 10 | template class tod_vmpriority<5>; 11 | template class tod_vmpriority<6>; 12 | template class tod_vmpriority<7>; 13 | template class tod_vmpriority<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/dense_tensor/impl/tod_vmpriority_impl.h: -------------------------------------------------------------------------------- 1 | #include "../dense_tensor_ctrl.h" 2 | #include "../tod_vmpriority.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template 8 | void tod_vmpriority::set_priority() { 9 | 10 | dense_tensor_base_ctrl(m_t).req_priority(true); 11 | } 12 | 13 | 14 | template 15 | void tod_vmpriority::unset_priority() { 16 | 17 | dense_tensor_base_ctrl(m_t).req_priority(false); 18 | } 19 | 20 | 21 | } // namespace libtensor 22 | 23 | -------------------------------------------------------------------------------- /libtensor/diag_block_tensor/impl/diag_btod_addition_schedule.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class addition_schedule<1, diag_btod_traits>; 8 | template class addition_schedule<2, diag_btod_traits>; 9 | template class addition_schedule<3, diag_btod_traits>; 10 | template class addition_schedule<4, diag_btod_traits>; 11 | template class addition_schedule<5, diag_btod_traits>; 12 | template class addition_schedule<6, diag_btod_traits>; 13 | template class addition_schedule<7, diag_btod_traits>; 14 | template class addition_schedule<8, diag_btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/diag_block_tensor/impl/diag_btod_aux_add.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_add<1, diag_btod_traits>; 8 | template class gen_bto_aux_add<2, diag_btod_traits>; 9 | template class gen_bto_aux_add<3, diag_btod_traits>; 10 | template class gen_bto_aux_add<4, diag_btod_traits>; 11 | template class gen_bto_aux_add<5, diag_btod_traits>; 12 | template class gen_bto_aux_add<6, diag_btod_traits>; 13 | template class gen_bto_aux_add<7, diag_btod_traits>; 14 | template class gen_bto_aux_add<8, diag_btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/diag_block_tensor/impl/diag_btod_aux_copy.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_aux_copy<1, diag_btod_traits>; 8 | template class gen_bto_aux_copy<2, diag_btod_traits>; 9 | template class gen_bto_aux_copy<3, diag_btod_traits>; 10 | template class gen_bto_aux_copy<4, diag_btod_traits>; 11 | template class gen_bto_aux_copy<5, diag_btod_traits>; 12 | template class gen_bto_aux_copy<6, diag_btod_traits>; 13 | template class gen_bto_aux_copy<7, diag_btod_traits>; 14 | template class gen_bto_aux_copy<8, diag_btod_traits>; 15 | 16 | 17 | } // namespace libtensor 18 | -------------------------------------------------------------------------------- /libtensor/diag_block_tensor/impl/diag_btod_random.C: -------------------------------------------------------------------------------- 1 | #include "diag_btod_random_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_btod_random<1>; 7 | template class diag_btod_random<2>; 8 | template class diag_btod_random<3>; 9 | template class diag_btod_random<4>; 10 | template class diag_btod_random<5>; 11 | template class diag_btod_random<6>; 12 | 13 | 14 | } // namespace libtensor 15 | -------------------------------------------------------------------------------- /libtensor/diag_block_tensor/impl/diag_btod_unfold_block_list.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../diag_btod_traits.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class gen_bto_unfold_block_list<1, diag_btod_traits>; 8 | template class gen_bto_unfold_block_list<2, diag_btod_traits>; 9 | template class gen_bto_unfold_block_list<3, diag_btod_traits>; 10 | template class gen_bto_unfold_block_list<4, diag_btod_traits>; 11 | template class gen_bto_unfold_block_list<5, diag_btod_traits>; 12 | template class gen_bto_unfold_block_list<6, diag_btod_traits>; 13 | template class gen_bto_unfold_block_list<8, diag_btod_traits>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/diag_block_tensor/impl/tod_conv_diag_block_tensor.C: -------------------------------------------------------------------------------- 1 | #include "tod_conv_diag_block_tensor_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class tod_conv_diag_block_tensor<1>; 7 | template class tod_conv_diag_block_tensor<2>; 8 | template class tod_conv_diag_block_tensor<3>; 9 | template class tod_conv_diag_block_tensor<4>; 10 | template class tod_conv_diag_block_tensor<5>; 11 | template class tod_conv_diag_block_tensor<6>; 12 | 13 | 14 | } // namespace libtensor 15 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tensor.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "diag_tensor_impl.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template class diag_tensor<1, double, allocator >; 8 | template class diag_tensor<2, double, allocator >; 9 | template class diag_tensor<3, double, allocator >; 10 | template class diag_tensor<4, double, allocator >; 11 | template class diag_tensor<5, double, allocator >; 12 | template class diag_tensor<6, double, allocator >; 13 | template class diag_tensor<7, double, allocator >; 14 | template class diag_tensor<8, double, allocator >; 15 | 16 | 17 | } // namespace libtensor 18 | 19 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_to_add_space.C: -------------------------------------------------------------------------------- 1 | #include "diag_to_add_space_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_to_add_space<1>; 7 | template class diag_to_add_space<2>; 8 | template class diag_to_add_space<3>; 9 | template class diag_to_add_space<4>; 10 | template class diag_to_add_space<5>; 11 | template class diag_to_add_space<6>; 12 | template class diag_to_add_space<7>; 13 | template class diag_to_add_space<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_adjust_space.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_adjust_space_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_adjust_space<1>; 7 | template class diag_tod_adjust_space<2>; 8 | template class diag_tod_adjust_space<3>; 9 | template class diag_tod_adjust_space<4>; 10 | template class diag_tod_adjust_space<5>; 11 | template class diag_tod_adjust_space<6>; 12 | template class diag_tod_adjust_space<7>; 13 | template class diag_tod_adjust_space<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_aux_constr_add.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_aux_constr_add_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_aux_constr_add<1>; 7 | template class diag_tod_aux_constr_add<2>; 8 | template class diag_tod_aux_constr_add<3>; 9 | template class diag_tod_aux_constr_add<4>; 10 | template class diag_tod_aux_constr_add<5>; 11 | template class diag_tod_aux_constr_add<6>; 12 | template class diag_tod_aux_constr_add<7>; 13 | template class diag_tod_aux_constr_add<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_aux_constr_base.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_aux_constr_base_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_aux_constr_base<1>; 7 | template class diag_tod_aux_constr_base<2>; 8 | template class diag_tod_aux_constr_base<3>; 9 | template class diag_tod_aux_constr_base<4>; 10 | template class diag_tod_aux_constr_base<5>; 11 | template class diag_tod_aux_constr_base<6>; 12 | template class diag_tod_aux_constr_base<7>; 13 | template class diag_tod_aux_constr_base<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_aux_dotprod.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_aux_dotprod_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_aux_dotprod<1>; 7 | template class diag_tod_aux_dotprod<2>; 8 | template class diag_tod_aux_dotprod<3>; 9 | template class diag_tod_aux_dotprod<4>; 10 | template class diag_tod_aux_dotprod<5>; 11 | template class diag_tod_aux_dotprod<6>; 12 | template class diag_tod_aux_dotprod<7>; 13 | template class diag_tod_aux_dotprod<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_copy.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_copy_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_copy<1>; 7 | template class diag_tod_copy<2>; 8 | template class diag_tod_copy<3>; 9 | template class diag_tod_copy<4>; 10 | template class diag_tod_copy<5>; 11 | template class diag_tod_copy<6>; 12 | template class diag_tod_copy<7>; 13 | template class diag_tod_copy<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_dotprod.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_dotprod_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_dotprod<1>; 7 | template class diag_tod_dotprod<2>; 8 | template class diag_tod_dotprod<3>; 9 | template class diag_tod_dotprod<4>; 10 | template class diag_tod_dotprod<5>; 11 | template class diag_tod_dotprod<6>; 12 | template class diag_tod_dotprod<7>; 13 | template class diag_tod_dotprod<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_mult1.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_mult1_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_mult1<1>; 7 | template class diag_tod_mult1<2>; 8 | template class diag_tod_mult1<3>; 9 | template class diag_tod_mult1<4>; 10 | template class diag_tod_mult1<5>; 11 | template class diag_tod_mult1<6>; 12 | template class diag_tod_mult1<7>; 13 | template class diag_tod_mult1<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_random.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_random_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_random<1>; 7 | template class diag_tod_random<2>; 8 | template class diag_tod_random<3>; 9 | template class diag_tod_random<4>; 10 | template class diag_tod_random<5>; 11 | template class diag_tod_random<6>; 12 | template class diag_tod_random<7>; 13 | template class diag_tod_random<8>; 14 | 15 | 16 | } // namespace libtensor 17 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/diag_tod_set.C: -------------------------------------------------------------------------------- 1 | #include "diag_tod_set_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | template class diag_tod_set<1>; 7 | template class diag_tod_set<2>; 8 | template class diag_tod_set<3>; 9 | template class diag_tod_set<4>; 10 | template class diag_tod_set<5>; 11 | template class diag_tod_set<6>; 12 | template class diag_tod_set<7>; 13 | template class diag_tod_set<8>; 14 | 15 | 16 | } // namespace libtensor 17 | 18 | -------------------------------------------------------------------------------- /libtensor/diag_tensor/impl/tod_conv_diag_tensor.C: -------------------------------------------------------------------------------- 1 | #include "tod_conv_diag_tensor_impl.h" 2 | 3 | namespace libtensor { 4 | 5 | template class tod_conv_diag_tensor<1>; 6 | template class tod_conv_diag_tensor<2>; 7 | template class tod_conv_diag_tensor<3>; 8 | template class tod_conv_diag_tensor<4>; 9 | template class tod_conv_diag_tensor<5>; 10 | template class tod_conv_diag_tensor<6>; 11 | template class tod_conv_diag_tensor<7>; 12 | template class tod_conv_diag_tensor<8>; 13 | 14 | } // namespace libtensor 15 | 16 | -------------------------------------------------------------------------------- /libtensor/expr/btensor/eval_btensor.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_EVAL_BTENSOR_H 2 | #define LIBTENSOR_EXPR_EVAL_BTENSOR_H 3 | 4 | namespace libtensor { 5 | namespace expr { 6 | 7 | 8 | /** \brief Processor of evaluation plan for btensor result type 9 | \tparam T Tensor element type. 10 | 11 | \ingroup libtensor_expr_btensor 12 | **/ 13 | template class eval_btensor; 14 | 15 | 16 | } // namespace expr 17 | } // namespace libtensor 18 | 19 | #include "eval_btensor_double.h" 20 | 21 | #endif // LIBTENSOR_EXPR_EVAL_BTENSOR_H 22 | -------------------------------------------------------------------------------- /libtensor/expr/btensor/impl/node_interm.C: -------------------------------------------------------------------------------- 1 | #include "node_interm.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_interm_base::k_op_type[] = "interm"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /libtensor/expr/ctf_btensor/eval_ctf_btensor.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_EVAL_CTF_BTENSOR_H 2 | #define LIBTENSOR_EXPR_EVAL_CTF_BTENSOR_H 3 | 4 | namespace libtensor { 5 | namespace expr { 6 | 7 | 8 | /** \brief Processor of evaluation plan for ctf_btensor result type 9 | \tparam T Tensor element type. 10 | 11 | \ingroup libtensor_expr_ctf_btensor 12 | **/ 13 | template class eval_ctf_btensor; 14 | 15 | 16 | } // namespace expr 17 | } // namespace libtensor 18 | 19 | #include "eval_ctf_btensor_double.h" 20 | 21 | #endif // LIBTENSOR_EXPR_EVAL_CTF_BTENSOR_H 22 | -------------------------------------------------------------------------------- /libtensor/expr/ctf_btensor/impl/node_ctf_btensor_interm.C: -------------------------------------------------------------------------------- 1 | #include "node_ctf_btensor_interm.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_ctf_btensor_interm_base::k_op_type[] = "interm_ctf_btensor"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_add.C: -------------------------------------------------------------------------------- 1 | #include "node_add.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_add::k_op_type[] = "add"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_assign.C: -------------------------------------------------------------------------------- 1 | #include "node_assign.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_assign::k_op_type[] = "assign"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_const_scalar.C: -------------------------------------------------------------------------------- 1 | #include "node_const_scalar.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_const_scalar_base::k_op_type[] = "const_scalar"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_contract.C: -------------------------------------------------------------------------------- 1 | #include "node_contract.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_contract::k_op_type[] = "contract"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_diag.C: -------------------------------------------------------------------------------- 1 | #include "node_diag.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_diag::k_op_type[] = "diag"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_dirsum.C: -------------------------------------------------------------------------------- 1 | #include "node_dirsum.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_dirsum::k_op_type[] = "dirsum"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_div.C: -------------------------------------------------------------------------------- 1 | #include "node_div.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_div::k_op_type[] = "div"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_ident.C: -------------------------------------------------------------------------------- 1 | #include "node_ident.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_ident::k_op_type[] = "ident"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_null.C: -------------------------------------------------------------------------------- 1 | #include "node_null.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_null::k_op_type[] = "null"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_reblock.C: -------------------------------------------------------------------------------- 1 | #include "node_reblock.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_reblock::k_op_type[] = "reblock"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_scalar.C: -------------------------------------------------------------------------------- 1 | #include "node_scalar.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_scalar_base::k_op_type[] = "scalar"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_scale.C: -------------------------------------------------------------------------------- 1 | #include "node_scale.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_scale::k_op_type[] = "scale"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_set.C: -------------------------------------------------------------------------------- 1 | #include "node_set.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_set::k_op_type[] = "set"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_symm.C: -------------------------------------------------------------------------------- 1 | #include "node_symm.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_symm_base::k_op_type[] = "symm"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_trace.C: -------------------------------------------------------------------------------- 1 | #include "node_trace.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | 7 | const char node_trace::k_clazz[] = "node_trace"; 8 | const char node_trace::k_op_type[] = "trace"; 9 | 10 | 11 | } // namespace expr 12 | } // namespace libtensor 13 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_transform.C: -------------------------------------------------------------------------------- 1 | #include "node_transform.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_transform_base::k_op_type[] = "transform"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/node_unblock.C: -------------------------------------------------------------------------------- 1 | #include "node_unblock.h" 2 | 3 | namespace libtensor { 4 | namespace expr { 5 | 6 | const char node_unblock::k_op_type[] = "unblock"; 7 | 8 | } // namespace expr 9 | } // namespace libtensor 10 | -------------------------------------------------------------------------------- /libtensor/expr/dag/print_node.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_PRINT_NODE_H 2 | #define LIBTENSOR_EXPR_PRINT_NODE_H 3 | 4 | #include 5 | #include "node.h" 6 | 7 | namespace libtensor { 8 | namespace expr { 9 | 10 | 11 | /** \brief Prints the contents of a node 12 | \param n Node. 13 | \param os Output stream. 14 | 15 | \ingroup libtensor_expr_dag 16 | **/ 17 | void print_node(const node &n, std::ostream &os); 18 | 19 | 20 | } // namespace expr 21 | } // namespace libtensor 22 | 23 | 24 | #endif // LIBTENSOR_EXPR_PRINT_NODE_H 25 | -------------------------------------------------------------------------------- /libtensor/expr/dag/print_tree.C: -------------------------------------------------------------------------------- 1 | #include "print_node.h" 2 | #include "print_tree.h" 3 | 4 | namespace libtensor { 5 | namespace expr { 6 | 7 | 8 | void print_tree(const expr_tree &tr, expr_tree::node_id_t h, 9 | std::ostream &os, size_t indent) { 10 | 11 | const node &n = tr.get_vertex(h); 12 | os << std::string(indent, ' ') << h << ": "; 13 | print_node(n, os); 14 | os << std::endl; 15 | 16 | const expr_tree::edge_list_t &e = tr.get_edges_out(h); 17 | for (size_t i = 0; i < e.size(); i++) { 18 | print_tree(tr, e[i], os, indent + 2); 19 | } 20 | } 21 | 22 | 23 | } // namespace expr 24 | } // namespace libtensor 25 | -------------------------------------------------------------------------------- /libtensor/expr/eval/eval.C: -------------------------------------------------------------------------------- 1 | #include "default_eval_selector.h" 2 | #include "eval.h" 3 | #include "eval_register.h" 4 | 5 | namespace libtensor { 6 | namespace expr { 7 | 8 | 9 | void eval::evaluate(const expr_tree &e, eval_selector_i &es) const { 10 | 11 | eval_register::get_instance().try_evaluators(es); 12 | es.get_selected().evaluate(e); 13 | } 14 | 15 | 16 | void eval::evaluate(const expr_tree &e) const { 17 | 18 | default_eval_selector es(e); 19 | eval_register::get_instance().try_evaluators(es); 20 | es.get_selected().evaluate(e); 21 | } 22 | 23 | 24 | } // namespace expr 25 | } // namespace libtensor 26 | -------------------------------------------------------------------------------- /libtensor/expr/eval/eval_register.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "eval_register.h" 3 | 4 | namespace libtensor { 5 | namespace expr { 6 | 7 | 8 | void eval_register::add_evaluator(const eval_i &e) { 9 | 10 | m_eval.push_back(&e); 11 | } 12 | 13 | 14 | void eval_register::remove_evaluator(const eval_i &e) { 15 | 16 | std::vector::iterator i = 17 | std::find(m_eval.begin(), m_eval.end(), &e); 18 | if(i == m_eval.end()) return; 19 | m_eval.erase(i); 20 | } 21 | 22 | 23 | void eval_register::try_evaluators(eval_selector_i &es) { 24 | 25 | for(std::vector::const_iterator i = m_eval.begin(); 26 | i != m_eval.end(); ++i) es.try_evaluator(**i); 27 | } 28 | 29 | 30 | } // namespace expr 31 | } // namespace libtensor 32 | -------------------------------------------------------------------------------- /libtensor/expr/iface/any_tensor_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_ANY_TENSOR_IMPL_H 2 | #define LIBTENSOR_EXPR_ANY_TENSOR_IMPL_H 3 | 4 | #include "any_tensor.h" 5 | #include "expr_rhs.h" 6 | #include "node_ident_any_tensor.h" 7 | 8 | namespace libtensor { 9 | namespace expr { 10 | 11 | 12 | template 13 | expr_rhs any_tensor::make_rhs(const label &l) { 14 | 15 | expr_tree e(node_ident_any_tensor(*this)); 16 | return expr_rhs(e, l); 17 | } 18 | 19 | 20 | } // namespace expr 21 | } // namespace libtensor 22 | 23 | #endif // LIBTENSOR_EXPR_ANY_TENSOR_IMPL_H 24 | -------------------------------------------------------------------------------- /libtensor/expr/operators/operators.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_OPERATORS_H 2 | #define LIBTENSOR_EXPR_OPERATORS_H 3 | 4 | /** \defgroup libtensor_expr_operators Expressions programming interface 5 | \ingroup libtensor_expr 6 | **/ 7 | 8 | #include "contract.h" 9 | #include "diag.h" 10 | #include "dirsum.h" 11 | #include "dot_product.h" 12 | #include "ewmult.h" 13 | #include "multiply_divide.h" 14 | #include "plus_minus.h" 15 | #include "set.h" 16 | #include "symm_asymm.h" 17 | #include "trace.h" 18 | 19 | #endif // LIBTENSOR_EXPR_OPERATORS_H 20 | -------------------------------------------------------------------------------- /libtensor/expr/opt/opt_add_before_transf.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_OPT_ADD_BEFORE_TRANSF_H 2 | #define LIBTENSOR_EXPR_OPT_ADD_BEFORE_TRANSF_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | namespace expr { 8 | 9 | 10 | /** \brief Swaps connections to place additions before tensor transformations 11 | 12 | This optimizer performs the following transformation: 13 | ( Tr ( + E1 E2 ... En ) ) --> ( + ( Tr E1 ) ( Tr E2 ) ... ( Tr En ) ) 14 | 15 | \ingroup libtensor_expr_opt 16 | **/ 17 | void opt_add_before_transf(graph &g); 18 | 19 | 20 | } // namespace expr 21 | } // namespace libtensor 22 | 23 | 24 | #endif // LIBTENSOR_EXPR_OPT_ADD_BEFORE_TRANSF_H 25 | -------------------------------------------------------------------------------- /libtensor/expr/opt/opt_merge_adjacent_transf.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_OPT_MERGE_ADJACENT_TRANSF_H 2 | #define LIBTENSOR_EXPR_OPT_MERGE_ADJACENT_TRANSF_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | namespace expr { 8 | 9 | 10 | /** \brief Merges adjacent transformation nodes 11 | 12 | This optimizer locates any chained adjacent transformation nodes and 13 | replaces them with one representing the combined transformation: 14 | ( Tr[2] ( Tr[1] E ) ) --> ( Tr[1+2] E ) 15 | 16 | \ingroup libtensor_expr_opt 17 | **/ 18 | void opt_merge_adjacent_transf(graph &g); 19 | 20 | 21 | } // namespace expr 22 | } // namespace libtensor 23 | 24 | 25 | #endif // LIBTENSOR_EXPR_OPT_MERGE_ADJACENT_TRANSF_H 26 | -------------------------------------------------------------------------------- /libtensor/expr/opt/opt_merge_equiv_ident.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_OPT_MERGE_EQUIV_IDENT_H 2 | #define LIBTENSOR_EXPR_OPT_MERGE_EQUIV_IDENT_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | namespace expr { 8 | 9 | 10 | /** \brief Merges equivalent tensor identity leaves 11 | 12 | This optimizer replaces any duplicates of the identity of the same tensor 13 | with one identity node. 14 | 15 | \ingroup libtensor_expr_opt 16 | **/ 17 | void opt_merge_equiv_ident(graph &g); 18 | 19 | 20 | } // namespace expr 21 | } // namespace libtensor 22 | 23 | 24 | #endif // LIBTENSOR_EXPR_OPT_MERGE_EQUIV_IDENT_H 25 | -------------------------------------------------------------------------------- /libtensor/gen_block_tensor/impl/auto_rwlock.C: -------------------------------------------------------------------------------- 1 | #include "../auto_rwlock.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | auto_rwlock::auto_rwlock(libutil::rwlock &lock) : 7 | m_lock(lock), m_wr(false) { 8 | 9 | m_lock.rdlock(); 10 | } 11 | 12 | 13 | auto_rwlock::~auto_rwlock() { 14 | 15 | m_lock.unlock(); 16 | } 17 | 18 | 19 | void auto_rwlock::upgrade() { 20 | 21 | if(!m_wr) { 22 | m_lock.unlock(); 23 | m_lock.wrlock(); 24 | m_wr = true; 25 | } 26 | } 27 | 28 | 29 | void auto_rwlock::downgrade() { 30 | 31 | if(m_wr) { 32 | m_lock.unlock(); 33 | m_lock.rdlock(); 34 | m_wr = false; 35 | } 36 | } 37 | 38 | 39 | } // namespace libtensor 40 | -------------------------------------------------------------------------------- /libtensor/kernels/dadd1/kern_dadd1.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "kern_dadd1_impl.h" 3 | #include "kern_dadd1_i_i_x_impl.h" 4 | #include "kern_dadd1_ij_ij_x_impl.h" 5 | #include "kern_dadd1_ij_ji_x_impl.h" 6 | 7 | namespace libtensor { 8 | 9 | 10 | template class kern_dadd1; 11 | 12 | 13 | } // namespace libtensor 14 | -------------------------------------------------------------------------------- /libtensor/kernels/dadd2/kern_dadd2.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "kern_dadd2_impl.h" 3 | #include "kern_dadd2_i_i_x_x_impl.h" 4 | #include "kern_dadd2_i_x_i_x_impl.h" 5 | 6 | namespace libtensor { 7 | 8 | 9 | template class kern_dadd2; 10 | 11 | 12 | } // namespace libtensor 13 | -------------------------------------------------------------------------------- /libtensor/kernels/dcopy/kern_dcopy.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "kern_dcopy_impl.h" 3 | #include "kern_dcopy_i_i_x_impl.h" 4 | #include "kern_dcopy_ij_ij_x_impl.h" 5 | #include "kern_dcopy_ij_ji_x_impl.h" 6 | 7 | namespace libtensor { 8 | 9 | 10 | template class kern_dcopy; 11 | 12 | 13 | } // namespace libtensor 14 | -------------------------------------------------------------------------------- /libtensor/kernels/ddiv1/kern_ddiv1.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "kern_ddiv1_impl.h" 3 | #include "kern_ddiv1_i_i_x_impl.h" 4 | 5 | namespace libtensor { 6 | 7 | 8 | template class kern_ddiv1; 9 | 10 | 11 | } // namespace libtensor 12 | -------------------------------------------------------------------------------- /libtensor/kernels/ddiv2/kern_ddiv2.C: -------------------------------------------------------------------------------- 1 | #include "../kern_ddiv2.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | const char *kern_ddiv2::k_clazz = "kern_ddiv2"; 7 | 8 | 9 | void kern_ddiv2::run(void*, const loop_registers<2, 1> &r) { 10 | 11 | r.m_ptrb[0][0] += m_d * r.m_ptra[0][0] / r.m_ptra[1][0]; 12 | 13 | } 14 | 15 | 16 | kernel_base *kern_ddiv2::match(double d, list_t &in, 17 | list_t &out) { 18 | 19 | kern_ddiv2 zz; 20 | zz.m_d = d; 21 | 22 | return new kern_ddiv2(zz); 23 | } 24 | 25 | 26 | } // namespace libtensor 27 | -------------------------------------------------------------------------------- /libtensor/kernels/ddivadd1/kern_ddivadd1.C: -------------------------------------------------------------------------------- 1 | #include "../kern_ddivadd1.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | const char *kern_ddivadd1::k_clazz = "kern_ddivadd1"; 7 | 8 | 9 | void kern_ddivadd1::run(void*, const loop_registers<1, 1> &r) { 10 | 11 | r.m_ptrb[0][0] = r.m_ptrb[0][0] + (r.m_ptrb[0][0] * m_d) / r.m_ptra[0][0]; 12 | } 13 | 14 | 15 | kernel_base *kern_ddivadd1::match(double d, list_t &in, 16 | list_t &out) { 17 | 18 | kern_ddivadd1 zz; 19 | zz.m_d = d; 20 | 21 | return new kern_ddivadd1(zz); 22 | } 23 | 24 | 25 | } // namespace libtensor 26 | -------------------------------------------------------------------------------- /libtensor/kernels/dmul1/kern_dmul1.C: -------------------------------------------------------------------------------- 1 | #include "../kern_dmul1.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | const char *kern_dmul1::k_clazz = "kern_dmul1"; 7 | 8 | 9 | void kern_dmul1::run(void*, const loop_registers<1, 1> &r) { 10 | 11 | r.m_ptrb[0][0] *= r.m_ptra[0][0] * m_d; 12 | } 13 | 14 | 15 | kernel_base *kern_dmul1::match(double d, list_t &in, 16 | list_t &out) { 17 | 18 | kern_dmul1 zz; 19 | zz.m_d = d; 20 | 21 | return new kern_dmul1(zz); 22 | } 23 | 24 | 25 | } // namespace libtensor 26 | -------------------------------------------------------------------------------- /libtensor/kernels/dmuladd1/kern_dmuladd1.C: -------------------------------------------------------------------------------- 1 | #include "../kern_dmuladd1.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | const char *kern_dmuladd1::k_clazz = "kern_dmuladd1"; 7 | 8 | 9 | void kern_dmuladd1::run(void*, const loop_registers<1, 1> &r) { 10 | 11 | r.m_ptrb[0][0] = r.m_ptrb[0][0] + r.m_ptra[0][0] * r.m_ptrb[0][0] * m_d; 12 | } 13 | 14 | 15 | kernel_base *kern_dmuladd1::match(double d, list_t &in, 16 | list_t &out) { 17 | 18 | kern_dmuladd1 zz; 19 | zz.m_d = d; 20 | 21 | return new kern_dmuladd1(zz); 22 | } 23 | 24 | 25 | } // namespace libtensor 26 | -------------------------------------------------------------------------------- /libtensor/libxm/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2017 Ilya Kaliman 2 | 3 | Permission to use, copy, modify, and distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /libtensor/libxm/src/Makefile: -------------------------------------------------------------------------------- 1 | XM_A= libxm.a 2 | XM_O= alloc.o \ 3 | blockspace.o \ 4 | contract.o \ 5 | dim.o \ 6 | scalar.o \ 7 | tensor.o \ 8 | util.o \ 9 | xm.o 10 | 11 | AR= ar rc 12 | RANLIB= ranlib 13 | 14 | $(XM_A): $(XM_O) 15 | $(AR) $@ $(XM_O) 16 | $(RANLIB) $@ 17 | 18 | clean: 19 | rm -f $(XM_A) $(XM_O) 20 | 21 | .PHONY: clean 22 | -------------------------------------------------------------------------------- /libtensor/linalg.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_LINALG1_H 2 | #define LIBTENSOR_LINALG1_H 3 | 4 | /** \defgroup libtensor_linalg Wrappers for linear algebra primitives 5 | \ingroup libtensor 6 | **/ 7 | 8 | 9 | #ifdef USE_MKL 10 | #include "linalg/lapack_mkl.h" 11 | #else // USE_MKL 12 | #ifdef USE_ACML 13 | #include "linalg/lapack_acml.h" 14 | #else // USE_ACML 15 | #ifdef USE_ESSL 16 | #include "linalg/lapack_essl.h" 17 | #else // USE_ESSL 18 | #include "linalg/lapack_generic.h" 19 | #endif // USE_ESSL 20 | #endif // USE_ACML 21 | #endif // USE_MKL 22 | 23 | #endif // LIBTENSOR_LINALG1_H 24 | -------------------------------------------------------------------------------- /libtensor/linalg/cblas/cblas_h.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CBLAS_H_H 2 | #define LIBTENSOR_CBLAS_H_H 3 | 4 | #ifdef USE_CBLAS 5 | extern "C" { // Fixes older cblas.h versions without extern "C" 6 | #include 7 | } 8 | #endif // USE_CBLAS 9 | 10 | #ifdef USE_GSL 11 | #include 12 | #endif // USE_GSL 13 | 14 | #endif // LIBTENSOR_CBLAS_H_H 15 | -------------------------------------------------------------------------------- /libtensor/linalg/essl/essl_h.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_ESSL_H_H 2 | #define LIBTENSOR_ESSL_H_H 3 | 4 | 5 | #include 6 | #include 7 | 8 | #endif // LIBTENSOR_ESSL_H_H 9 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/er_optimize_inst.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "er_optimize.h" 3 | #include "er_optimize_impl.h" 4 | 5 | namespace libtensor { 6 | 7 | 8 | template class er_optimize<1>; 9 | template class er_optimize<2>; 10 | template class er_optimize<3>; 11 | template class er_optimize<4>; 12 | template class er_optimize<5>; 13 | template class er_optimize<6>; 14 | template class er_optimize<7>; 15 | template class er_optimize<8>; 16 | template class er_optimize<9>; 17 | template class er_optimize<10>; 18 | template class er_optimize<11>; 19 | template class er_optimize<12>; 20 | template class er_optimize<13>; 21 | template class er_optimize<14>; 22 | template class er_optimize<15>; 23 | template class er_optimize<16>; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/print_symmetry_inst.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../print_symmetry.h" 3 | 4 | namespace libtensor { 5 | 6 | 7 | template<> 8 | std::ostream &operator<<(std::ostream &os, const scalar_transf &tr) { 9 | 10 | os << tr.get_coeff(); 11 | return os; 12 | } 13 | 14 | 15 | } // namespace libtensor 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/so_apply_inst.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../so_apply.h" 3 | #include "so_apply_impl.h" 4 | 5 | namespace libtensor { 6 | 7 | template class so_apply<1, double>; 8 | template class so_apply<2, double>; 9 | template class so_apply<3, double>; 10 | template class so_apply<4, double>; 11 | template class so_apply<5, double>; 12 | template class so_apply<6, double>; 13 | 14 | } // namespace libtensor 15 | 16 | 17 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/so_apply_se_label_inst.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../so_apply_se_label.h" 3 | #include "so_apply_se_label_impl.h" 4 | 5 | namespace libtensor { 6 | 7 | template 8 | class symmetry_operation_impl< so_apply<1, double>, se_label<1, double> >; 9 | template 10 | class symmetry_operation_impl< so_apply<2, double>, se_label<2, double> >; 11 | template 12 | class symmetry_operation_impl< so_apply<3, double>, se_label<3, double> >; 13 | template 14 | class symmetry_operation_impl< so_apply<4, double>, se_label<4, double> >; 15 | template 16 | class symmetry_operation_impl< so_apply<5, double>, se_label<5, double> >; 17 | template 18 | class symmetry_operation_impl< so_apply<6, double>, se_label<6, double> >; 19 | 20 | } // namespace libtensor 21 | 22 | 23 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/so_apply_se_part_inst.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../so_apply_se_part.h" 3 | #include "so_apply_se_part_impl.h" 4 | 5 | namespace libtensor { 6 | 7 | template 8 | class symmetry_operation_impl< so_apply<1, double>, se_part<1, double> >; 9 | template 10 | class symmetry_operation_impl< so_apply<2, double>, se_part<2, double> >; 11 | template 12 | class symmetry_operation_impl< so_apply<3, double>, se_part<3, double> >; 13 | template 14 | class symmetry_operation_impl< so_apply<4, double>, se_part<4, double> >; 15 | template 16 | class symmetry_operation_impl< so_apply<5, double>, se_part<5, double> >; 17 | template 18 | class symmetry_operation_impl< so_apply<6, double>, se_part<6, double> >; 19 | 20 | } // namespace libtensor 21 | 22 | 23 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/so_apply_se_perm_inst.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../so_apply_se_perm.h" 3 | #include "so_apply_se_perm_impl.h" 4 | 5 | namespace libtensor { 6 | 7 | template 8 | class symmetry_operation_impl< so_apply<1, double>, se_perm<1, double> >; 9 | template 10 | class symmetry_operation_impl< so_apply<2, double>, se_perm<2, double> >; 11 | template 12 | class symmetry_operation_impl< so_apply<3, double>, se_perm<3, double> >; 13 | template 14 | class symmetry_operation_impl< so_apply<4, double>, se_perm<4, double> >; 15 | template 16 | class symmetry_operation_impl< so_apply<5, double>, se_perm<5, double> >; 17 | template 18 | class symmetry_operation_impl< so_apply<6, double>, se_perm<6, double> >; 19 | 20 | } // namespace libtensor 21 | 22 | 23 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/so_copy_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SO_COPY_IMPL_H 2 | #define LIBTENSOR_SO_COPY_IMPL_H 3 | 4 | namespace libtensor { 5 | 6 | template 7 | void so_copy::perform(symmetry &sym2) { 8 | 9 | sym2.clear(); 10 | 11 | for(typename symmetry::iterator i = m_sym1.begin(); 12 | i != m_sym1.end(); i++) { 13 | 14 | const symmetry_element_set &set1 = m_sym1.get_subset(i); 15 | 16 | for(typename symmetry_element_set::const_iterator j = 17 | set1.begin(); j != set1.end(); j++) { 18 | 19 | sym2.insert(set1.get_elem(j)); 20 | } 21 | } 22 | } 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_SO_COPY_IMPL_H 27 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/so_permute_inst.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../so_permute.h" 3 | #include "so_permute_impl.h" 4 | 5 | namespace libtensor { 6 | 7 | 8 | template class so_permute<1, double>; 9 | template class so_permute<2, double>; 10 | template class so_permute<3, double>; 11 | template class so_permute<4, double>; 12 | template class so_permute<5, double>; 13 | template class so_permute<6, double>; 14 | template class so_permute<7, double>; 15 | template class so_permute<8, double>; 16 | 17 | 18 | } // namespace libtensor 19 | 20 | 21 | -------------------------------------------------------------------------------- /libtensor/symmetry/inst/so_symmetrize_inst.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../so_symmetrize.h" 3 | #include "so_symmetrize_impl.h" 4 | 5 | namespace libtensor { 6 | 7 | 8 | template class so_symmetrize<1, double>; 9 | template class so_symmetrize<2, double>; 10 | template class so_symmetrize<3, double>; 11 | template class so_symmetrize<4, double>; 12 | template class so_symmetrize<5, double>; 13 | template class so_symmetrize<6, double>; 14 | template class so_symmetrize<7, double>; 15 | template class so_symmetrize<8, double>; 16 | 17 | 18 | } // namespace libtensor 19 | 20 | 21 | -------------------------------------------------------------------------------- /libtensor/symmetry/symmetry_operation_base.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SYMMETRY_OPERATION_BASE_H 2 | #define LIBTENSOR_SYMMETRY_OPERATION_BASE_H 3 | 4 | #include "symmetry_operation_handlers.h" 5 | 6 | namespace libtensor { 7 | 8 | 9 | template 10 | class symmetry_operation_base { 11 | public: 12 | symmetry_operation_base() { 13 | 14 | symmetry_operation_handlers::install_handlers(); 15 | } 16 | }; 17 | 18 | 19 | } // namespace libtensor 20 | 21 | #endif // LIBTENSOR_SYMMETRY_OPERATION_BASE_H 22 | 23 | -------------------------------------------------------------------------------- /libtensor/symmetry/symmetry_operation_handlers.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SYMMETRY_OPERATION_HANDLERS_H 2 | #define LIBTENSOR_SYMMETRY_OPERATION_HANDLERS_H 3 | 4 | #include "symmetry_operation_dispatcher.h" 5 | 6 | namespace libtensor { 7 | 8 | 9 | template 10 | class symmetry_operation_handlers_ex; 11 | 12 | 13 | template 14 | class symmetry_operation_handlers { 15 | public: 16 | static void install_handlers() { 17 | symmetry_operation_handlers_ex::install_handlers(); 18 | } 19 | }; 20 | 21 | 22 | template 23 | class symmetry_operation_handlers_ex { 24 | public: 25 | static void install_handlers() { } 26 | }; 27 | 28 | 29 | } // namespace libtensor 30 | 31 | #endif // LIBTENSOR_SYMMETRY_OPERATION_HANDLERS_H 32 | 33 | -------------------------------------------------------------------------------- /libtensor/symmetry/symmetry_operation_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SYMMETRY_OPERATION_IMPL_H 2 | #define LIBTENSOR_SYMMETRY_OPERATION_IMPL_H 3 | 4 | namespace libtensor { 5 | 6 | template 7 | class symmetry_operation_impl; 8 | 9 | } // namespace libtensor 10 | 11 | #endif // LIBTENSOR_SYMMETRY_OPERATION_IMPL_H 12 | 13 | -------------------------------------------------------------------------------- /libtensor/symmetry/symmetry_operation_params.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SYMMETRY_OPERATION_PARAMS_H 2 | #define LIBTENSOR_SYMMETRY_OPERATION_PARAMS_H 3 | 4 | namespace libtensor { 5 | 6 | class symmetry_operation_params_i { 7 | public: 8 | virtual ~symmetry_operation_params_i() { } 9 | }; 10 | 11 | 12 | /** \brief Structure template for %symmetry operation parameters 13 | \tparam OperT Symmetry operation type. 14 | 15 | \ingroup libtensor_symmetry 16 | **/ 17 | template 18 | class symmetry_operation_params; 19 | 20 | 21 | } // namespace libtensor 22 | 23 | #endif // LIBTENSOR_SYMMETRY_OPERATION_PARAMS_H 24 | 25 | -------------------------------------------------------------------------------- /libtensor/version.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | namespace libtensor { 5 | 6 | const char version::k_status[] = "trunk"; 7 | const char *version::k_authors[] = { 8 | "Evgeny Epifanovsky", 9 | "Michael Wormit", 10 | "Dmitry Zuev", 11 | "Sam Manzer", 12 | "Ilya Kaliman" 13 | }; 14 | 15 | 16 | version::version() : m_status(k_status) { 17 | 18 | std::ostringstream ss; 19 | ss << k_major << "." << k_minor << "-" << m_status; 20 | m_string = ss.str(); 21 | 22 | size_t nauthors = sizeof(k_authors)/sizeof(char*); 23 | for(size_t i = 0; i < nauthors; i++) { 24 | m_authors.push_back(std::string(k_authors[i])); 25 | } 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /libutil/exceptions/rethrowable_i.C: -------------------------------------------------------------------------------- 1 | #include "rethrowable_i.h" 2 | 3 | namespace libutil { 4 | 5 | 6 | rethrowable_i::~rethrowable_i() throw() { 7 | 8 | } 9 | 10 | 11 | } // namespace libutil 12 | 13 | -------------------------------------------------------------------------------- /libutil/exceptions/rethrowable_i.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_RETHROWABLE_I_H 2 | #define LIBUTIL_RETHROWABLE_I_H 3 | 4 | namespace libutil { 5 | 6 | 7 | /** \brief Rethrowable exception interface 8 | 9 | \ingroup libutil_exceptions 10 | **/ 11 | class rethrowable_i { 12 | public: 13 | /** \brief Virtual destructor 14 | **/ 15 | virtual ~rethrowable_i() throw(); 16 | 17 | /** \brief Clones this exception using operator new 18 | **/ 19 | virtual rethrowable_i *clone() const throw() = 0; 20 | 21 | /** \brief Rethrows this exception 22 | **/ 23 | virtual void rethrow() const = 0; 24 | 25 | }; 26 | 27 | 28 | } // namespace libutil 29 | 30 | #endif // LIBUTIL_RETHROWABLE_I_H 31 | -------------------------------------------------------------------------------- /libutil/thread_pool/task_i.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_TASK_I_H 2 | #define LIBUTIL_TASK_I_H 3 | 4 | namespace libutil { 5 | 6 | 7 | /** \brief Task interface 8 | 9 | \ingroup libutil_thread_pool 10 | **/ 11 | class task_i { 12 | public: 13 | /** \brief Virtual destructor 14 | **/ 15 | virtual ~task_i() { } 16 | 17 | /** \brief Returns the cost of the task in arbitrary units 18 | **/ 19 | virtual unsigned long get_cost() const = 0; 20 | 21 | /** \brief Performs the task 22 | **/ 23 | virtual void perform() = 0; 24 | 25 | }; 26 | 27 | 28 | } // namespace libutil 29 | 30 | #endif // LIBUTIL_TASK_I_H 31 | -------------------------------------------------------------------------------- /libutil/thread_pool/task_info.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_TASK_INFO_H 2 | #define LIBUTIL_TASK_INFO_H 3 | 4 | namespace libutil { 5 | 6 | 7 | class task_source; 8 | class task_i; 9 | 10 | 11 | struct task_info { 12 | 13 | task_source *tsrc; 14 | task_i *tsk; 15 | 16 | }; 17 | 18 | 19 | } // namespace libutil 20 | 21 | #endif // LIBUTIL_TASK_INFO_H 22 | 23 | -------------------------------------------------------------------------------- /libutil/thread_pool/task_iterator_i.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_TASK_ITERATOR_I_H 2 | #define LIBUTIL_TASK_ITERATOR_I_H 3 | 4 | #include "task_i.h" 5 | 6 | namespace libutil { 7 | 8 | 9 | /** \brief Task iterator 10 | 11 | \ingroup libutil_thread_pool 12 | **/ 13 | class task_iterator_i { 14 | public: 15 | /** \brief Returns true if there are more tasks, false otherwise 16 | **/ 17 | virtual bool has_more() const = 0; 18 | 19 | /** \brief Returns pointer to the next task 20 | **/ 21 | virtual task_i *get_next() = 0; 22 | 23 | }; 24 | 25 | 26 | } // namespace libutil 27 | 28 | #endif // LIBUTIL_TASK_ITERATOR_I_H 29 | 30 | -------------------------------------------------------------------------------- /libutil/thread_pool/task_observer_i.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_TASK_OBSERVER_I_H 2 | #define LIBUTIL_TASK_OBSERVER_I_H 3 | 4 | #include "task_i.h" 5 | 6 | namespace libutil { 7 | 8 | 9 | /** \brief Task observer (event handler) interface 10 | 11 | \ingroup libutil_thread_pool 12 | **/ 13 | class task_observer_i { 14 | public: 15 | virtual void notify_start_task(task_i *t) = 0; 16 | virtual void notify_finish_task(task_i *t) = 0; 17 | 18 | }; 19 | 20 | 21 | } // namespace libutil 22 | 23 | #endif // LIBUTIL_TASK_OBSERVER_I_H 24 | 25 | -------------------------------------------------------------------------------- /libutil/thread_pool/thread_pool_info.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_THREAD_POOL_INFO_H 2 | #define LIBUTIL_THREAD_POOL_INFO_H 3 | 4 | #include "task_source.h" 5 | #include "thread_pool.h" 6 | 7 | namespace libutil { 8 | 9 | 10 | /** \brief Contains worker-specific info about the thread pool 11 | 12 | \ingroup libutil_thread_pool 13 | **/ 14 | struct thread_pool_info { 15 | 16 | thread_pool *pool; //!< Worker owner 17 | task_source *tsrc; //!< Current source of tasks 18 | worker *w; //!< Worker 19 | 20 | thread_pool_info() : pool(0), tsrc(0), w(0) { } 21 | 22 | }; 23 | 24 | 25 | } // namespace libutil 26 | 27 | #endif // LIBUTIL_THREAD_POOL_INFO_H 28 | 29 | -------------------------------------------------------------------------------- /libutil/thread_pool/unknown_exception.C: -------------------------------------------------------------------------------- 1 | #include "unknown_exception.h" 2 | 3 | namespace libutil { 4 | 5 | 6 | const char *unknown_exception::k_what = "libutil::unknown_exception"; 7 | 8 | 9 | unknown_exception::~unknown_exception() throw() { 10 | 11 | } 12 | 13 | 14 | const char *unknown_exception::what() const throw() { 15 | 16 | return k_what; 17 | } 18 | 19 | 20 | rethrowable_i *unknown_exception::clone() const throw() { 21 | 22 | try { 23 | return new unknown_exception; 24 | } catch(...) { 25 | return 0; 26 | } 27 | } 28 | 29 | 30 | void unknown_exception::rethrow() const { 31 | 32 | throw unknown_exception(); 33 | } 34 | 35 | 36 | } // namespace libutil 37 | -------------------------------------------------------------------------------- /libutil/thread_pool/worker.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "thread_pool.h" 3 | #include "worker.h" 4 | 5 | namespace libutil { 6 | 7 | 8 | void worker::run() { 9 | 10 | m_pool.worker_main(this); 11 | } 12 | 13 | 14 | void worker::notify_ready() { 15 | 16 | if(m_start_cond) m_start_cond->signal(); // Notify the thread pool 17 | m_start_cond = 0; 18 | } 19 | 20 | 21 | } // namespace libutil 22 | 23 | -------------------------------------------------------------------------------- /libutil/threads/auto_lock.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_AUTO_LOCK_H 2 | #define LIBUTIL_AUTO_LOCK_H 3 | 4 | namespace libutil { 5 | 6 | 7 | /** \brief Automatically obtains a lock upon construction and releases it upon 8 | destruction 9 | \tparam Mutex Mutex type. 10 | 11 | \sa mutex, spinlock 12 | 13 | \ingroup libutil_threads 14 | **/ 15 | template 16 | class auto_lock { 17 | private: 18 | Mutex &m_mtx; //!< Underlying mutex 19 | 20 | public: 21 | auto_lock(Mutex &mtx) : m_mtx(mtx) { 22 | m_mtx.lock(); 23 | } 24 | 25 | ~auto_lock() throw() { 26 | m_mtx.unlock(); 27 | } 28 | 29 | }; 30 | 31 | 32 | } // namespace libutil 33 | 34 | #endif // LIBUTIL_AUTO_LOCK_H 35 | -------------------------------------------------------------------------------- /libutil/threads/base/thread_i.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_THREAD_I_H 2 | #define LIBUTIL_THREAD_I_H 3 | 4 | namespace libutil { 5 | 6 | 7 | /** \brief Thread interface 8 | 9 | \ingroup libutil_threads 10 | **/ 11 | class thread_i { 12 | public: 13 | /** \brief Virtual destructor 14 | **/ 15 | virtual ~thread_i() { } 16 | 17 | /** \brief Runs the process in the thread 18 | **/ 19 | virtual void run() = 0; 20 | 21 | }; 22 | 23 | 24 | } // namespace libutil 25 | 26 | #endif // LIBUTIL_THREAD_I_H 27 | -------------------------------------------------------------------------------- /libutil/threads/macos/spinlock_macos.C: -------------------------------------------------------------------------------- 1 | #include "spinlock_macos.h" 2 | 3 | namespace libutil { 4 | 5 | 6 | void spinlock_macos::create(mutex_id_type &id) { 7 | 8 | id = OS_SPINLOCK_INIT; 9 | } 10 | 11 | 12 | void spinlock_macos::destroy(mutex_id_type &id) { 13 | 14 | id = OS_SPINLOCK_INIT; 15 | } 16 | 17 | 18 | void spinlock_macos::lock(mutex_id_type &id) { 19 | 20 | OSSpinLockLock(&id); 21 | } 22 | 23 | 24 | void spinlock_macos::unlock(mutex_id_type &id) { 25 | 26 | OSSpinLockUnlock(&id); 27 | } 28 | 29 | 30 | } // namespace libutil 31 | -------------------------------------------------------------------------------- /libutil/threads/posix/rwlock_posix.C: -------------------------------------------------------------------------------- 1 | #include "rwlock_posix.h" 2 | 3 | namespace libutil { 4 | 5 | 6 | void rwlock_posix::create(rwlock_id_type &id) { 7 | 8 | pthread_rwlock_init(&id, 0); 9 | } 10 | 11 | 12 | void rwlock_posix::destroy(rwlock_id_type &id) { 13 | 14 | pthread_rwlock_destroy(&id); 15 | } 16 | 17 | 18 | void rwlock_posix::rdlock(rwlock_id_type &id) { 19 | 20 | pthread_rwlock_rdlock(&id); 21 | } 22 | 23 | 24 | void rwlock_posix::wrlock(rwlock_id_type &id) { 25 | 26 | pthread_rwlock_wrlock(&id); 27 | } 28 | 29 | 30 | void rwlock_posix::unlock(rwlock_id_type &id) { 31 | 32 | pthread_rwlock_unlock(&id); 33 | } 34 | 35 | 36 | } // namespace libutil 37 | -------------------------------------------------------------------------------- /libutil/threads/posix/spinlock_posix.C: -------------------------------------------------------------------------------- 1 | #include "spinlock_posix.h" 2 | 3 | namespace libutil { 4 | 5 | 6 | void spinlock_posix::create(mutex_id_type &id) { 7 | 8 | pthread_spin_init(&id, 0); 9 | } 10 | 11 | 12 | void spinlock_posix::destroy(mutex_id_type &id) { 13 | 14 | pthread_spin_destroy(&id); 15 | } 16 | 17 | 18 | void spinlock_posix::lock(mutex_id_type &id) { 19 | 20 | pthread_spin_lock(&id); 21 | } 22 | 23 | 24 | void spinlock_posix::unlock(mutex_id_type &id) { 25 | 26 | pthread_spin_unlock(&id); 27 | } 28 | 29 | 30 | } // namespace libutil 31 | -------------------------------------------------------------------------------- /libutil/threads/posix/tls_posix.C: -------------------------------------------------------------------------------- 1 | #include "tls_posix.h" 2 | 3 | namespace libutil { 4 | 5 | 6 | tls_posix_base::tls_posix_base(void (*destructor)(void*)) { 7 | 8 | pthread_key_create(&m_key, destructor); 9 | } 10 | 11 | 12 | tls_posix_base::~tls_posix_base() { 13 | 14 | pthread_key_delete(m_key); 15 | } 16 | 17 | 18 | void tls_posix_base::set_ptr(void *ptr) { 19 | 20 | pthread_setspecific(m_key, ptr); 21 | } 22 | 23 | 24 | void *tls_posix_base::get_ptr() { 25 | 26 | return pthread_getspecific(m_key); 27 | } 28 | 29 | 30 | } // namespace libutil 31 | -------------------------------------------------------------------------------- /libutil/threads/thread.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_THREAD_H 2 | #define LIBUTIL_THREAD_H 3 | 4 | #include "base/thread_base.h" 5 | 6 | namespace libutil { 7 | 8 | 9 | /** \brief Thread 10 | 11 | \ingroup libutil_threads 12 | **/ 13 | class thread; 14 | 15 | 16 | } // namespace libutil 17 | 18 | 19 | #if defined(USE_PTHREADS) 20 | 21 | #include "posix/thread_posix.h" 22 | namespace libutil { 23 | class thread : public thread_base { }; 24 | } // namespace libutil 25 | 26 | 27 | #elif defined(USE_WIN32_THREADS) 28 | 29 | #include "windows/thread_windows.h" 30 | namespace libutil { 31 | class thread : public thread_base { }; 32 | } // namespace libutil 33 | 34 | #endif 35 | 36 | 37 | #endif // LIBUTIL_THREAD_H 38 | -------------------------------------------------------------------------------- /libutil/threads/windows/tls_windows.C: -------------------------------------------------------------------------------- 1 | #include "tls_windows.h" 2 | 3 | namespace libutil { 4 | 5 | 6 | mutex tls_windows_destructor_list::m_lock; 7 | std::vector 8 | tls_windows_destructor_list::m_lst; 9 | 10 | 11 | } // namespace libutil 12 | -------------------------------------------------------------------------------- /libutil/timings/timing_record.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUTIL_TIMING_RECORD_H 2 | #define LIBUTIL_TIMING_RECORD_H 3 | 4 | #include "timer.h" 5 | 6 | namespace libutil { 7 | 8 | 9 | struct timing_record { 10 | 11 | time_diff_t m_total; 12 | size_t m_ncalls; 13 | 14 | timing_record(const time_diff_t &t) : m_total(t), m_ncalls(1) { 15 | 16 | } 17 | 18 | void add_call(const time_diff_t &t) { 19 | m_ncalls++; 20 | m_total += t; 21 | } 22 | 23 | void add_calls(const timing_record &other) { 24 | m_ncalls += other.m_ncalls; 25 | m_total += other.m_total; 26 | } 27 | 28 | }; 29 | 30 | 31 | } // namespace libutil 32 | 33 | #endif // LIBUTIL_TIMING_RECORD_H 34 | -------------------------------------------------------------------------------- /libutil/version.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | namespace libutil { 5 | 6 | 7 | const unsigned version::k_major = 1; 8 | const unsigned version::k_minor = 1; 9 | const char *version::k_status = "trunk"; 10 | const char *version::k_authors[] = { 11 | "Evgeny Epifanovsky" 12 | }; 13 | 14 | 15 | version::version() : m_status(k_status) { 16 | 17 | std::ostringstream ss; 18 | ss << k_major << "." << k_minor << "-" << m_status; 19 | m_string = ss.str(); 20 | 21 | size_t nauthors = sizeof(k_authors)/sizeof(char*); 22 | for(size_t i = 0; i < nauthors; i++) { 23 | m_authors.push_back(std::string(k_authors[i])); 24 | } 25 | } 26 | 27 | 28 | } // namespace libutil 29 | -------------------------------------------------------------------------------- /performance_tests/libtensor_ctf_benchmarks: -------------------------------------------------------------------------------- 1 | ../build/performance_tests/libtensor_ctf_benchmarks -------------------------------------------------------------------------------- /performance_tests/performance_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_PERFORMANCE_TEST_H 2 | #define LIBTENSOR_PERFORMANCE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Performance tests base class 10 | \tparam Repeats Number of times a performance test is repeated to get 11 | a meaningful result 12 | 13 | \ingroup libtensor_performance_tests 14 | **/ 15 | template 16 | class performance_test : public libtest::unit_test { 17 | protected: 18 | virtual void do_calculate() = 0; 19 | 20 | public: 21 | virtual void perform() throw(libtest::test_exception) 22 | { 23 | for ( size_t i=0; i 5 | 6 | namespace libtensor 7 | { 8 | 9 | class batch_kernels_test : public libtest::unit_test 10 | { 11 | public: 12 | virtual void perform() throw(libtest::test_exception); 13 | private: 14 | void test_batch_kernel_permute_A_direct() throw(libtest::test_exception); 15 | void test_batch_kernel_contract2() throw(libtest::test_exception); 16 | }; 17 | 18 | } /* namespace libtensor */ 19 | 20 | #endif /* BATCH_KERNELS_TEST_H */ 21 | -------------------------------------------------------------------------------- /tests/block_sparse/batch_provider_test.h: -------------------------------------------------------------------------------- 1 | #ifndef BATCH_PROVIDER_TEST_H 2 | #define BATCH_PROVIDER_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor 7 | { 8 | 9 | class batch_provider_test: public libtest::unit_test 10 | { 11 | public: 12 | virtual void perform() throw(libtest::test_exception); 13 | private: 14 | void test_permute_3d_sparse_120() throw(libtest::test_exception); 15 | void test_contract2() throw(libtest::test_exception); 16 | }; 17 | 18 | } /* namespace libtensor */ 19 | 20 | 21 | #endif /* BATCH_PROVIDER_TEST_H */ 22 | -------------------------------------------------------------------------------- /tests/block_sparse/graphene_01_03_split_points_X.txt: -------------------------------------------------------------------------------- 1 | 168 2 | 336 3 | 504 4 | 672 5 | 840 6 | 1008 7 | 1176 8 | 1344 9 | 1512 10 | 1680 11 | 1848 12 | 2016 13 | 2184 14 | 2352 15 | 2432 16 | 2512 17 | 2592 18 | 2672 19 | 2752 20 | 2832 21 | 2912 22 | 2992 23 | 3072 24 | -------------------------------------------------------------------------------- /tests/block_sparse/test_fixtures/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | template 9 | std::vector< sequence > get_sig_blocks(const size_t arr[][N],size_t n_entries) 10 | { 11 | std::vector< sequence > sig_blocks(n_entries); 12 | for(size_t i = 0; i < n_entries; ++i) 13 | for(size_t j = 0; j < N; ++j) sig_blocks[i][j] = arr[i][j]; 14 | return sig_blocks; 15 | } 16 | 17 | } // namespace libtensor 18 | #endif /* UTIL_H */ 19 | -------------------------------------------------------------------------------- /tests/block_sparse/timer.C: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | double read_timer() 4 | { 5 | static bool initialized = false; 6 | static struct timeval start; 7 | struct timeval end; 8 | if( !initialized ) 9 | { 10 | gettimeofday( &start, 0 ); 11 | initialized = true; 12 | } 13 | 14 | gettimeofday( &end, 0 ); 15 | 16 | return (end.tv_sec - start.tv_sec) + 1.0e-6 * (end.tv_usec - start.tv_usec); 17 | } 18 | -------------------------------------------------------------------------------- /tests/block_sparse/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef TIMER_H 2 | #define TIMER_H 3 | 4 | double read_timer(); 5 | 6 | #endif /* TIMER_H */ 7 | -------------------------------------------------------------------------------- /tests/block_tensor/block_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BLOCK_TENSOR_TEST_H 2 | #define LIBTENSOR_BLOCK_TENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::block_tensor class 10 | 11 | \ingroup libtensor_tests_core 12 | **/ 13 | class block_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_nonzero_blocks_1(); 19 | void test_nonzero_blocks_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_BLOCK_TENSOR_TEST_H 27 | -------------------------------------------------------------------------------- /tests/block_tensor/bto_contract2_sym_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTO_CONTRACT2_SYM_TEST_H 2 | #define LIBTENSOR_BTO_CONTRACT2_SYM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::bto_contract2_sym class 10 | 11 | \ingroup libtensor_tests_tod 12 | **/ 13 | class bto_contract2_sym_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2() throw(libtest::test_exception); 20 | void test_3() throw(libtest::test_exception); 21 | void test_4() throw(libtest::test_exception); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_BTO_CONTRACT2_SYM_TEST_H 29 | -------------------------------------------------------------------------------- /tests/block_tensor/btod_random_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_RANDOM_TEST_H 2 | #define LIBTENSOR_BTOD_RANDOM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::btod_random class 9 | 10 | \ingroup libtensor_tests_btod 11 | **/ 12 | class btod_random_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | }; 17 | 18 | } // namespace libtensor 19 | 20 | #endif // LIBTENSOR_BTOD_RANDOM_TEST_H 21 | -------------------------------------------------------------------------------- /tests/block_tensor/btod_set_elem_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SET_ELEM_TEST_H 2 | #define LIBTENSOR_BTOD_SET_ELEM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::btod_set_elem class 9 | 10 | \ingroup libtensor_tests_btod 11 | **/ 12 | class btod_set_elem_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | void test_3() throw(libtest::test_exception); 20 | }; 21 | 22 | } // namespace libtensor 23 | 24 | #endif // LIBTENSOR_BTOD_SET_ELEM_TEST_H 25 | -------------------------------------------------------------------------------- /tests/block_tensor/btod_set_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SET_TEST_H 2 | #define LIBTENSOR_BTOD_SET_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::btod_set class 9 | 10 | \ingroup libtensor_tests_btod 11 | **/ 12 | class btod_set_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | }; 20 | 21 | } // namespace libtensor 22 | 23 | #endif // LIBTENSOR_BTOD_SET_TEST_H 24 | -------------------------------------------------------------------------------- /tests/block_tensor/btod_symcontract3_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SYMCONTRACT3_TEST_H 2 | #define LIBTENSOR_BTOD_SYMCONTRACT3_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::btod_symcontract3 class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class btod_symcontract3_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_contr_1(); 19 | void test_contr_2(); 20 | void test_contr_3(); 21 | void test_contr_4(); 22 | void test_contr_5(); 23 | void test_contr_6(); 24 | void test_contr_7(); 25 | 26 | }; 27 | 28 | 29 | } // namespace libtensor 30 | 31 | #endif // LIBTENSOR_BTOD_SYMCONTRACT3_TEST_H 32 | -------------------------------------------------------------------------------- /tests/block_tensor/btod_symmetrize4_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_SYMMETRIZE4_TEST_H 2 | #define LIBTENSOR_BTOD_SYMMETRIZE4_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::btod_symmetrize4 class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class btod_symmetrize4_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_BTOD_SYMMETRIZE4_TEST_H 26 | -------------------------------------------------------------------------------- /tests/block_tensor/btod_tridiagonalize_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_TRIDIAGONALIZE_TEST_H 2 | #define LIBTENSOR_BTOD_TRIDIAGONALIZE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::btod_tridiagonalize class 9 | 10 | \ingroup libtensor_tests_btod 11 | **/ 12 | class btod_tridiagonalize_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | void test_3() throw(libtest::test_exception); 20 | }; 21 | 22 | } // namespace libtensor 23 | 24 | #endif // LIBTENSOR_BTOD_TRIDIAGONALIZE_TEST_H 25 | -------------------------------------------------------------------------------- /tests/block_tensor/btod_vmpriority_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTOD_VMPRIORITY_TEST_H 2 | #define LIBTENSOR_BTOD_VMPRIORITY_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::btod_vmpriority class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class btod_vmpriority_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_BTOD_VMPRIORITY_TEST_H 26 | -------------------------------------------------------------------------------- /tests/block_tensor/direct_block_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIRECT_BLOCK_TENSOR_TEST_H 2 | #define LIBTENSOR_DIRECT_BLOCK_TENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::direct_block_tensor class 10 | 11 | \ingroup libtensor_tests_core 12 | **/ 13 | class direct_block_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_op_1(); 19 | void test_op_2(); 20 | void test_op_3(); 21 | void test_op_4(); 22 | void test_op_5(); 23 | void test_op_6(); 24 | 25 | }; 26 | 27 | 28 | } // namespace libtensor 29 | 30 | #endif // LIBTENSOR_DIRECT_BLOCK_TENSOR_TEST_H 31 | 32 | -------------------------------------------------------------------------------- /tests/block_tensor/gen_bto_aux_add_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_GEN_BTO_AUX_ADD_TEST_H 2 | #define LIBTENSOR_GEN_BTO_AUX_ADD_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::gen_bto_aux_add class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class gen_bto_aux_add_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | void test_1c(); 21 | void test_2(); 22 | void test_3a(); 23 | void test_3b(); 24 | 25 | }; 26 | 27 | 28 | } // namespace libtensor 29 | 30 | #endif // LIBTENSOR_GEN_BTO_AUX_ADD_TEST_H 31 | -------------------------------------------------------------------------------- /tests/block_tensor/gen_bto_aux_copy_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_GEN_BTO_AUX_COPY_TEST_H 2 | #define LIBTENSOR_GEN_BTO_AUX_COPY_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::gen_bto_aux_copy class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class gen_bto_aux_copy_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | void test_1c(); 21 | void test_2(); 22 | void test_exc_1(); 23 | 24 | }; 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_GEN_BTO_AUX_COPY_TEST_H 30 | -------------------------------------------------------------------------------- /tests/block_tensor/gen_bto_contract2_clst_builder_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_GEN_BTO_CONTRACT2_CLST_BUILDER_TEST_H 2 | #define LIBTENSOR_GEN_BTO_CONTRACT2_CLST_BUILDER_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::gen_bto_contract2_clst_builder class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class gen_bto_contract2_clst_builder_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_GEN_BTO_CONTRACT2_CLST_BUILDER_TEST_H 29 | -------------------------------------------------------------------------------- /tests/block_tensor/gen_bto_dirsum_sym_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_GEN_BTO_DIRSUM_SYM_TEST_H 2 | #define LIBTENSOR_GEN_BTO_DIRSUM_SYM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::gen_bto_dirsum_sym class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class gen_bto_dirsum_sym_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2() throw(libtest::test_exception); 20 | void test_3() throw(libtest::test_exception); 21 | void test_4() throw(libtest::test_exception); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_GEN_BTO_DIRSUM_SYM_TEST_H 29 | -------------------------------------------------------------------------------- /tests/block_tensor/gen_bto_symcontract2_sym_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_GEN_BTO_SYMCONTRACT2_SYM_TEST_H 2 | #define LIBTENSOR_GEN_BTO_SYMCONTRACT2_SYM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::gen_bto_symcontract2_sym class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class gen_bto_symcontract2_sym_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_GEN_BTO_SYMCONTRACT2_SYM_TEST_H 28 | -------------------------------------------------------------------------------- /tests/block_tensor/gen_bto_unfold_symmetry_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_GEN_BTO_UNFOLD_SYMMETRY_TEST_H 2 | #define LIBTENSOR_GEN_BTO_UNFOLD_SYMMETRY_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::gen_bto_unfold_symmetry class 10 | 11 | \ingroup libtensor_tests_btod 12 | **/ 13 | class gen_bto_unfold_symmetry_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_GEN_BTO_UNFOLD_SYMMETRY_TEST_H 29 | -------------------------------------------------------------------------------- /tests/core/immutable_test.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../test_utils.h" 3 | 4 | using namespace libtensor; 5 | 6 | namespace { 7 | 8 | class immut : public immutable { 9 | protected: 10 | virtual void on_set_immutable() { } 11 | }; 12 | 13 | } 14 | 15 | int main() { 16 | 17 | immut im; 18 | if(im.is_immutable()) { 19 | return fail_test("immutable_test::perform()", __FILE__, __LINE__, 20 | "New object must be mutable"); 21 | } 22 | im.set_immutable(); 23 | if(!im.is_immutable()) { 24 | return fail_test("immutable_test::perform()", __FILE__, __LINE__, 25 | "set_immutable() failed"); 26 | } 27 | 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/core/index_range_test.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../test_utils.h" 3 | 4 | using namespace libtensor; 5 | 6 | int test_ctor() { 7 | 8 | libtensor::index<2> i1, i2; 9 | i2[0] = 2; i2[1] = 2; 10 | index_range<2> ir(i1, i2); 11 | 12 | return 0; 13 | } 14 | 15 | 16 | int main() { 17 | return test_ctor(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/core/version_test.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "../test_utils.h" 4 | 5 | using namespace libtensor; 6 | 7 | 8 | int main() { 9 | 10 | std::ostringstream ss; 11 | ss << version::get_major() << "." << version::get_minor() << "-" 12 | << version::get_status(); 13 | 14 | std::string ver_ref(ss.str()), ver(version::get_string()); 15 | if(ver != ver_ref) { 16 | std::ostringstream sserr; 17 | sserr << "Version inconsistency: " << ver << " (actual) vs. " 18 | << ver_ref << " (ref)."; 19 | return fail_test("version_test::perform()", __FILE__, __LINE__, 20 | sserr.str().c_str()); 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_collect_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_COLLECT_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_COLLECT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_collect class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_collect_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_BTOD_COLLECT_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_contract2_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_CONTRACT2_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_CONTRACT2_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_contract2 class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_contract2_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(double d); 20 | void test_3(double d); 21 | void test_4(double d); 22 | void test_5(double d); 23 | void test_6(double d); 24 | 25 | }; 26 | 27 | 28 | } // namespace libtensor 29 | 30 | #endif // LIBTENSOR_CTF_BTOD_CONTRACT2_TEST_H 31 | 32 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_copy_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_COPY_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_COPY_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_copy class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_copy_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | void test_2a(); 21 | void test_2b(); 22 | void test_3a(); 23 | void test_3b(); 24 | 25 | }; 26 | 27 | 28 | } // namespace libtensor 29 | 30 | #endif // LIBTENSOR_CTF_BTOD_COPY_TEST_H 31 | 32 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_diag_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_DIAG_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_DIAG_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_diag class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_diag_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_BTOD_DIAG_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_dirsum_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_DIRSUM_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_DIRSUM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_dirsum class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_dirsum_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | void test_2a(); 21 | void test_2b(); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_CTF_BTOD_DIRSUM_TEST_H 29 | 30 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_distribute_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_DISTRIBUTE_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_DISTRIBUTE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_distribute class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_distribute_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_BTOD_DISTRIBUTE_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_dotprod_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_DOTPROD_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_DOTPROD_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_dotprod class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_dotprod_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_CTF_BTOD_DOTPROD_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_ewmult2_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_EWMULT2_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_EWMULT2_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_ewmult2 class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_ewmult2_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_CTF_BTOD_EWMULT2_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_mult1_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_MULT1_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_MULT1_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_mult1 class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_mult1_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_mult_1(); 19 | void test_div_1(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_BTOD_MULT1_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_mult_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_MULT_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_MULT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_mult class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_mult_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_mult_1(); 19 | void test_div_1(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_BTOD_MULT_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_random_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_RANDOM_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_RANDOM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_random class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_random_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_CTF_BTOD_RANDOM_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_scale_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_SCALE_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_SCALE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_scale class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_scale_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_BTOD_SCALE_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_set_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_SET_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_SET_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_set class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_set_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_BTOD_SET_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_symmetrize2_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_SYMMETRIZE2_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_SYMMETRIZE2_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_symmetrize2 class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_symmetrize2_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | void test_5(); 23 | void test_6(); 24 | 25 | }; 26 | 27 | 28 | } // namespace libtensor 29 | 30 | #endif // LIBTENSOR_CTF_BTOD_SYMMETRIZE2_TEST_H 31 | 32 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_symmetrize3_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_SYMMETRIZE3_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_SYMMETRIZE3_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_symmetrize3 class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_symmetrize3_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(bool symm); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_CTF_BTOD_SYMMETRIZE3_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/ctf_block_tensor/ctf_btod_trace_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTOD_TRACE_TEST_H 2 | #define LIBTENSOR_CTF_BTOD_TRACE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btod_trace class 10 | 11 | \ingroup libtensor_ctf_block_tensor_tests 12 | **/ 13 | class ctf_btod_trace_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_CTF_BTOD_TRACE_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_dense_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_DENSE_TENSOR_TEST_H 2 | #define LIBTENSOR_CTF_DENSE_TENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_dense_tensor class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_dense_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_CTF_DENSE_TENSOR_TEST_H 28 | 29 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_diag_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_DIAG_TEST_H 2 | #define LIBTENSOR_CTF_TOD_DIAG_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_diag class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_diag_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_TOD_DIAG_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_dirsum_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_DIRSUM_TEST_H 2 | #define LIBTENSOR_CTF_TOD_DIRSUM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_dirsum class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_dirsum_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_TOD_DIRSUM_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_distribute_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_DISTRIBUTE_TEST_H 2 | #define LIBTENSOR_CTF_TOD_DISTRIBUTE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_distribute class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_distribute_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | void test_5(); 23 | 24 | }; 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_CTF_TOD_DISTRIBUTE_TEST_H 30 | 31 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_dotprod_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_DOTPROD_TEST_H 2 | #define LIBTENSOR_CTF_TOD_DOTPROD_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_dotprod class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_dotprod_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | void test_2a(); 21 | void test_2b(); 22 | void test_3a(); 23 | void test_3b(); 24 | void test_4a(); 25 | 26 | }; 27 | 28 | 29 | } // namespace libtensor 30 | 31 | #endif // LIBTENSOR_CTF_TOD_DOTPROD_TEST_H 32 | 33 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_ewmult2_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_EWMULT2_TEST_H 2 | #define LIBTENSOR_CTF_TOD_EWMULT2_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_ewmult2 class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_ewmult2_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_TOD_EWMULT2_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_mult1_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_MULT1_TEST_H 2 | #define LIBTENSOR_CTF_TOD_MULT1_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_mult1 class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_mult1_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_mult_1a(); 19 | void test_mult_1b(); 20 | void test_div_1a(); 21 | void test_div_1b(); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_CTF_TOD_MULT1_TEST_H 29 | 30 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_mult_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_MULT_TEST_H 2 | #define LIBTENSOR_CTF_TOD_MULT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_mult class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_mult_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_mult_1a(); 19 | void test_mult_1b(); 20 | void test_div_1a(); 21 | void test_div_1b(); 22 | void test_2(bool zero, bool muldiv); 23 | 24 | }; 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_CTF_TOD_MULT_TEST_H 30 | 31 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_random_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_RANDOM_TEST_H 2 | #define LIBTENSOR_CTF_TOD_RANDOM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_random class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_random_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | void test_5(); 23 | void test_6(); 24 | 25 | }; 26 | 27 | 28 | } // namespace libtensor 29 | 30 | #endif // LIBTENSOR_CTF_TOD_RANDOM_TEST_H 31 | 32 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_scale_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_SCALE_TEST_H 2 | #define LIBTENSOR_CTF_TOD_SCALE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_scale class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_scale_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_CTF_TOD_SCALE_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_scatter_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_SCATTER_TEST_H 2 | #define LIBTENSOR_CTF_TOD_SCATTER_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_scatter class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_scatter_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_TOD_SCATTER_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_set_diag_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_SET_DIAG_TEST_H 2 | #define LIBTENSOR_CTF_TOD_SET_DIAG_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_set_diag class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_set_diag_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_TOD_SET_DIAG_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_set_symmetry_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_SET_SYMMETRY_TEST_H 2 | #define LIBTENSOR_CTF_TOD_SET_SYMMETRY_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_set_symmetry class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_set_symmetry_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1a(); 19 | void test_1b(); 20 | void test_2(); 21 | 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_CTF_TOD_SET_SYMMETRY_TEST_H 28 | 29 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_set_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_SET_TEST_H 2 | #define LIBTENSOR_CTF_TOD_SET_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_set class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_set_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(bool zero); 19 | void test_2(bool zero, double d); 20 | void test_3(bool zero, double d); 21 | 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_CTF_TOD_SET_TEST_H 28 | 29 | -------------------------------------------------------------------------------- /tests/ctf_dense_tensor/ctf_tod_trace_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TOD_TRACE_TEST_H 2 | #define LIBTENSOR_CTF_TOD_TRACE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_tod_trace class 10 | 11 | \ingroup libtensor_ctf_dense_tensor_tests 12 | **/ 13 | class ctf_tod_trace_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_CTF_TOD_TRACE_TEST_H 28 | 29 | -------------------------------------------------------------------------------- /tests/ctf_iface/ctf_btensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_BTENSOR_TEST_H 2 | #define LIBTENSOR_CTF_BTENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::ctf_btensor class 10 | 11 | \ingroup libtensor_ctf_iface_tests 12 | **/ 13 | class ctf_btensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_CTF_BTENSOR_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/ctf_iface/ctf_dot_product_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_DOT_PRODUCT_TEST_H 2 | #define LIBTENSOR_CTF_DOT_PRODUCT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests various expressions 9 | 10 | \ingroup libtensor_ctf_iface_tests 11 | **/ 12 | class ctf_dot_product_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1(); 18 | 19 | }; 20 | 21 | } // namespace libtensor 22 | 23 | #endif // LIBTENSOR_CTF_DOT_PRODUCT_TEST_H 24 | -------------------------------------------------------------------------------- /tests/ctf_iface/ctf_expr_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_EXPR_TEST_H 2 | #define LIBTENSOR_CTF_EXPR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests various expressions 9 | 10 | \ingroup libtensor_ctf_iface_tests 11 | **/ 12 | class ctf_expr_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_conv_1(); 18 | void test_conv_2(); 19 | void test_1(); 20 | void test_2(); 21 | void test_3(); 22 | void test_4(); 23 | void test_5(); 24 | void test_6(); 25 | void test_7(); 26 | void test_8(); 27 | 28 | }; 29 | 30 | } // namespace libtensor 31 | 32 | #endif // LIBTENSOR_CTF_EXPR_TEST_H 33 | -------------------------------------------------------------------------------- /tests/ctf_iface/ctf_mult_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_MULT_TEST_H 2 | #define LIBTENSOR_CTF_MULT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::mult function 10 | 11 | \ingroup libtensor_tests_ctf_iface 12 | **/ 13 | class ctf_mult_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_tt_1a(); 19 | void test_tt_1b(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_CTF_MULT_TEST_H 27 | -------------------------------------------------------------------------------- /tests/ctf_iface/ctf_set_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_SET_TEST_H 2 | #define LIBTENSOR_CTF_SET_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::set function 10 | 11 | \ingroup libtensor_tests_ctf_iface 12 | **/ 13 | class ctf_set_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_s_1(double d); 19 | void test_s_2(double d); 20 | void test_d_1(double d); 21 | void test_d_2(double d); 22 | void test_x_1(double d); 23 | void test_x_2(double d); 24 | }; 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_CTF_SET_TEST_H 30 | -------------------------------------------------------------------------------- /tests/ctf_iface/ctf_trace_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_CTF_TRACE_TEST_H 2 | #define LIBTENSOR_CTF_TRACE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::trace function 9 | 10 | \ingroup libtensor_tests_ctf_iface 11 | **/ 12 | class ctf_trace_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_t_1(); 18 | void test_t_2(); 19 | void test_t_3(); 20 | void test_e_1(); 21 | void test_e_2(); 22 | void test_e_3(); 23 | 24 | }; 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_CTF_TRACE_TEST_H 29 | -------------------------------------------------------------------------------- /tests/ctf_iface/libtensor_ctf_iface_suite.C: -------------------------------------------------------------------------------- 1 | #include "libtensor_ctf_iface_suite.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | libtensor_ctf_iface_suite::libtensor_ctf_iface_suite() : 7 | libtest::test_suite("libtensor_ctf_iface") { 8 | 9 | add_test("ctf_btensor", m_utf_ctf_btensor); 10 | add_test("ctf_dot_product", m_utf_ctf_dot_product); 11 | add_test("ctf_expr", m_utf_ctf_expr); 12 | add_test("ctf_mult", m_utf_ctf_mult); 13 | add_test("ctf_set", m_utf_ctf_set); 14 | add_test("ctf_trace", m_utf_ctf_trace); 15 | } 16 | 17 | 18 | } // namespace libtensor 19 | -------------------------------------------------------------------------------- /tests/dense_tensor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TESTS 2 | dense_tensor_test 3 | to_contract2_dims_test 4 | tod_add_test 5 | tod_apply_test 6 | tod_btconv_test 7 | tod_compare_test 8 | tod_contract2_test 9 | tod_copy_test 10 | tod_copy_wnd_test 11 | tod_diag_test 12 | tod_dirsum_test 13 | tod_dotprod_test 14 | tod_ewmult2_test 15 | tod_extract_test 16 | tod_import_raw_stream_test 17 | tod_import_raw_test 18 | tod_mult1_test 19 | tod_mult_test 20 | tod_random_test 21 | tod_scale_test 22 | tod_scatter_test 23 | tod_select_test 24 | tod_set_diag_test 25 | tod_set_elem_test 26 | tod_set_test 27 | tod_size_test 28 | tod_trace_test 29 | tod_vmpriority_test 30 | ) 31 | 32 | libtensor_add_tests(dense_tensor ${TESTS}) 33 | 34 | -------------------------------------------------------------------------------- /tests/dense_tensor/tod_vmpriority_test.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace libtensor; 7 | 8 | 9 | int main() { 10 | 11 | typedef allocator allocator_t; 12 | 13 | libtensor::index<4> i1, i2; 14 | i2[0]=3; i2[1]=3; i2[2]=4; i2[3]=4; 15 | index_range<4> ir(i1, i2); 16 | dimensions<4> dim(ir); 17 | dense_tensor<4, double, allocator_t> t(dim); 18 | 19 | tod_vmpriority<4>(t).set_priority(); 20 | tod_vmpriority<4>(t).unset_priority(); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/diag_block_tensor/diag_block_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_BLOCK_TENSOR_TEST_H 2 | #define LIBTENSOR_DIAG_BLOCK_TENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_block_tensor class 10 | 11 | \ingroup libtensor_diag_block_tensor_tests 12 | **/ 13 | class diag_block_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_DIAG_BLOCK_TENSOR_TEST_H 26 | -------------------------------------------------------------------------------- /tests/diag_block_tensor/diag_btod_contract2_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_BTOD_CONTRACT2_TEST_H 2 | #define LIBTENSOR_DIAG_BTOD_CONTRACT2_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_btod_contract2 class 10 | 11 | \ingroup libtensor_diag_block_tensor_tests 12 | **/ 13 | class diag_btod_contract2_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_DIAG_BTOD_CONTRACT2_TEST_H 27 | -------------------------------------------------------------------------------- /tests/diag_block_tensor/diag_btod_random_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_BTOD_RANDOM_TEST_H 2 | #define LIBTENSOR_DIAG_BTOD_RANDOM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_btod_random class 10 | 11 | \ingroup libtensor_diag_block_tensor_tests 12 | **/ 13 | class diag_btod_random_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_DIAG_BTOD_RANDOM_TEST_H 26 | -------------------------------------------------------------------------------- /tests/diag_block_tensor/libtensor_diag_block_tensor_suite.C: -------------------------------------------------------------------------------- 1 | #include "libtensor_diag_block_tensor_suite.h" 2 | 3 | namespace libtensor { 4 | 5 | 6 | libtensor_diag_block_tensor_suite::libtensor_diag_block_tensor_suite() : 7 | libtest::test_suite("libtensor_diag_block_tensor") { 8 | 9 | add_test("diag_block_tensor", m_utf_diag_block_tensor); 10 | add_test("diag_btod_contract2", m_utf_diag_btod_contract2); 11 | add_test("diag_btod_copy", m_utf_diag_btod_copy); 12 | add_test("diag_btod_random", m_utf_diag_btod_random); 13 | add_test("tod_conv_diag_block_tensor", m_utf_tod_conv_diag_block_tensor); 14 | } 15 | 16 | 17 | } // namespace libtensor 18 | 19 | -------------------------------------------------------------------------------- /tests/diag_block_tensor/tod_conv_diag_block_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_TOD_CONV_DIAG_BLOCK_TENSOR_TEST_H 2 | #define LIBTENSOR_TOD_CONV_DIAG_BLOCK_TENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::tod_conv_diag_block_tensor class 10 | 11 | \ingroup libtensor_diag_block_tensor_tests 12 | **/ 13 | class tod_conv_diag_block_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | void test_5(); 23 | void test_6(); 24 | 25 | }; 26 | 27 | 28 | } // namespace libtensor 29 | 30 | #endif // LIBTENSOR_TOD_CONV_DIAG_BLOCK_TENSOR_TEST_H 31 | -------------------------------------------------------------------------------- /tests/diag_tensor/diag_tensor_space_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_TENSOR_SPACE_TEST_H 2 | #define LIBTENSOR_DIAG_TENSOR_SPACE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_tensor_space class 10 | 11 | \ingroup libtensor_diag_tensor_tests 12 | **/ 13 | class diag_tensor_space_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2() throw(libtest::test_exception); 20 | 21 | void test_exc_1() throw(libtest::test_exception); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_DIAG_TENSOR_SPACE_TEST_H 29 | 30 | -------------------------------------------------------------------------------- /tests/diag_tensor/diag_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_TENSOR_TEST_H 2 | #define LIBTENSOR_DIAG_TENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_tensor class 10 | 11 | \ingroup libtensor_diag_tensor_tests 12 | **/ 13 | class diag_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2() throw(libtest::test_exception); 20 | void test_3() throw(libtest::test_exception); 21 | void test_4() throw(libtest::test_exception); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_DIAG_TENSOR_TEST_H 29 | 30 | -------------------------------------------------------------------------------- /tests/diag_tensor/diag_to_add_space_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_TO_ADD_SPACE_TEST_H 2 | #define LIBTENSOR_DIAG_TO_ADD_SPACE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_to_add_space class 10 | 11 | \ingroup libtensor_diag_tensor_tests 12 | **/ 13 | class diag_to_add_space_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_DIAG_TO_ADD_SPACE_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/diag_tensor/diag_tod_copy_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_TOD_COPY_TEST_H 2 | #define LIBTENSOR_DIAG_TOD_COPY_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_tod_copy class 10 | 11 | \ingroup libtensor_diag_tensor_tests 12 | **/ 13 | class diag_tod_copy_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_ij_1(size_t ni, size_t nj, double d); 19 | void test_ij_2(size_t ni, size_t nj, double d); 20 | void test_ij_3(size_t ni, double d); 21 | 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_DIAG_TOD_COPY_TEST_H 28 | 29 | -------------------------------------------------------------------------------- /tests/diag_tensor/diag_tod_dotprod_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_TOD_DOTPROD_TEST_H 2 | #define LIBTENSOR_DIAG_TOD_DOTPROD_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_tod_dotprod class 10 | 11 | \ingroup libtensor_diag_tensor_tests 12 | **/ 13 | class diag_tod_dotprod_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(size_t ni, size_t nj); 19 | void test_2(size_t ni, size_t nj); 20 | void test_3(size_t ni); 21 | void test_4(size_t ni, size_t nj); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_DIAG_TOD_DOTPROD_TEST_H 29 | 30 | -------------------------------------------------------------------------------- /tests/diag_tensor/diag_tod_random_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_TOD_RANDOM_TEST_H 2 | #define LIBTENSOR_DIAG_TOD_RANDOM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_tod_random class 10 | 11 | \ingroup libtensor_diag_tensor_tests 12 | **/ 13 | class diag_tod_random_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | void test_5(); 23 | 24 | }; 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_DIAG_TOD_RANDOM_TEST_H 30 | 31 | -------------------------------------------------------------------------------- /tests/diag_tensor/diag_tod_set_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_DIAG_TOD_SET_TEST_H 2 | #define LIBTENSOR_DIAG_TOD_SET_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::diag_tod_set class 10 | 11 | \ingroup libtensor_diag_tensor_tests 12 | **/ 13 | class diag_tod_set_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2(bool zero) throw(libtest::test_exception); 20 | void test_3(bool zero) throw(libtest::test_exception); 21 | 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_DIAG_TOD_SET_TEST_H 28 | 29 | -------------------------------------------------------------------------------- /tests/expr/expr_tree_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_TREE_TEST_H 2 | #define LIBTENSOR_EXPR_TREE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests class iface::expr_tree 9 | 10 | \ingroup libtensor_tests_iface 11 | **/ 12 | class expr_tree_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1(); 18 | void test_2(); 19 | void test_3(); 20 | void test_4(); 21 | void test_5(); 22 | void test_6(); 23 | void test_7(); 24 | 25 | }; 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_EXPR_TREE_TEST_H 30 | -------------------------------------------------------------------------------- /tests/expr/graph_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_GRAPH_TEST_H 2 | #define LIBTENSOR_GRAPH_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::graph class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class graph_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_GRAPH_TEST_H 28 | 29 | -------------------------------------------------------------------------------- /tests/expr/node_add_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_ADD_TEST_H 2 | #define LIBTENSOR_NODE_ADD_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_add class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_add_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_NODE_ADD_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/expr/node_contract_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_CONTRACT_TEST_H 2 | #define LIBTENSOR_NODE_CONTRACT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_contract class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_contract_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2() throw(libtest::test_exception); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_NODE_CONTRACT_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/expr/node_diag_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_DIAG_TEST_H 2 | #define LIBTENSOR_NODE_DIAG_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_diag class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_diag_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_NODE_DIAG_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/expr/node_dot_product_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_DOT_PRODUCT_TEST_H 2 | #define LIBTENSOR_NODE_DOT_PRODUCT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_dot_product class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_dot_product_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_NODE_DOT_PRODUCT_TEST_H 26 | -------------------------------------------------------------------------------- /tests/expr/node_ident_any_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_IDENT_TEST_H 2 | #define LIBTENSOR_NODE_IDENT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::expr::node_ident_any_tensor class 10 | 11 | \ingroup libtensor_tests_iface 12 | **/ 13 | class node_ident_any_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_TENSOR_LIST_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/expr/node_product_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_PRODUCT_TEST_H 2 | #define LIBTENSOR_NODE_PRODUCT_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_product class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_product_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | 29 | #endif // LIBTENSOR_NODE_PRODUCT_TEST_H 30 | -------------------------------------------------------------------------------- /tests/expr/node_scalar_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_SCALAR_TEST_H 2 | #define LIBTENSOR_NODE_SCALAR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_scalar class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_scalar_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_NODE_SCALAR_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/expr/node_set_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_SET_TEST_H 2 | #define LIBTENSOR_NODE_SET_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_set class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_set_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_NODE_SET_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/expr/node_trace_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_TRACE_TEST_H 2 | #define LIBTENSOR_NODE_TRACE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_trace class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_trace_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_NODE_TRACE_TEST_H 27 | -------------------------------------------------------------------------------- /tests/expr/node_transform_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_NODE_TRANSFORM_TEST_H 2 | #define LIBTENSOR_NODE_TRANSFORM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::node_transform class 10 | 11 | \ingroup libtensor_tests_expr 12 | **/ 13 | class node_transform_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_NODE_TRANSFORM_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/iface/any_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_ANY_TENSOR_TEST_H 2 | #define LIBTENSOR_ANY_TENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::any_tensor class 10 | 11 | \ingroup libtensor_tests_iface 12 | **/ 13 | class any_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_ANY_TENSOR_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/iface/btensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_BTENSOR_TEST_H 2 | #define LIBTENSOR_BTENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::btensor class 10 | 11 | \ingroup libtensor_tests_iface 12 | **/ 13 | class btensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2() throw(libtest::test_exception); 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_BTENSOR_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/iface/eval_btensor_double_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EVAL_BTENSOR_DOUBLE_TEST_H 2 | #define LIBTENSOR_EVAL_BTENSOR_DOUBLE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::iface::eval_btensor class 10 | 11 | \ingroup libtensor_tests_iface 12 | **/ 13 | class eval_btensor_double_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_copy_1(); 19 | void test_copy_2(); 20 | void test_copy_3(); 21 | void test_contract_1(); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_EVAL_BTENSOR_DOUBLE_TEST_H 29 | 30 | -------------------------------------------------------------------------------- /tests/iface/eval_register_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EVAL_REGISTER_TEST_H 2 | #define LIBTENSOR_EVAL_REGISTER_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::eval_register class 10 | 11 | \ingroup libtensor_tests_iface 12 | **/ 13 | class eval_register_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | 26 | #endif // LIBTENSOR_EVAL_REGISTER_TEST_H 27 | -------------------------------------------------------------------------------- /tests/iface/expr_tensor_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EXPR_TENSOR_TEST_H 2 | #define LIBTENSOR_EXPR_TENSOR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::expr_tensor class 10 | 11 | \ingroup libtensor_tests_iface 12 | **/ 13 | class expr_tensor_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1(); 19 | void test_2(); 20 | void test_3(); 21 | void test_4(); 22 | void test_5(); 23 | 24 | }; 25 | 26 | 27 | } // namespace libtensor 28 | 29 | #endif // LIBTENSOR_EXPR_TENSOR_TEST_H 30 | 31 | -------------------------------------------------------------------------------- /tests/iface/letter_expr_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_LETTER_EXPR_TEST_H 2 | #define LIBTENSOR_LETTER_EXPR_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::letter_expr class 10 | 11 | \ingroup libtensor_tests_iface 12 | **/ 13 | class letter_expr_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_contains(); 19 | void test_permutation(); 20 | 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_LETTER_EXPR_TEST_H 27 | 28 | -------------------------------------------------------------------------------- /tests/iface/letter_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_LETTER_TEST_H 2 | #define LIBTENSOR_LETTER_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::letter class 9 | 10 | \ingroup libtensor_tests_iface 11 | **/ 12 | class letter_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | }; 17 | 18 | } // namespace libtensor 19 | 20 | #endif // LIBTENSOR_LETTER_TEST_H 21 | 22 | -------------------------------------------------------------------------------- /tests/iface/set_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SET_TEST_H 2 | #define LIBTENSOR_SET_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::set function 9 | 10 | \ingroup libtensor_tests_iface 11 | **/ 12 | class set_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_s_1(double d); 18 | void test_s_2(double d); 19 | void test_d_1(double d); 20 | void test_d_2(double d); 21 | void test_x_1(double d); 22 | void test_x_2(double d); 23 | }; 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_SET_TEST_H 28 | -------------------------------------------------------------------------------- /tests/iface/trace_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_TRACE_TEST_H 2 | #define LIBTENSOR_TRACE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::trace function 9 | 10 | \ingroup libtensor_tests_iface 11 | **/ 12 | class trace_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_t_1(); 18 | void test_t_2(); 19 | void test_t_3(); 20 | void test_e_1(); 21 | void test_e_2(); 22 | void test_e_3(); 23 | 24 | void check_ref(const char *testname, double d, double d_ref) 25 | throw(libtest::test_exception); 26 | }; 27 | 28 | } // namespace libtensor 29 | 30 | #endif // LIBTENSOR_TRACE_TEST_H 31 | -------------------------------------------------------------------------------- /tests/libtensor_block_tensor_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_block_tensor_tests -------------------------------------------------------------------------------- /tests/libtensor_core_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_core_tests -------------------------------------------------------------------------------- /tests/libtensor_ctf_block_tensor_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_ctf_block_tensor_tests -------------------------------------------------------------------------------- /tests/libtensor_ctf_dense_tensor_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_ctf_dense_tensor_tests -------------------------------------------------------------------------------- /tests/libtensor_ctf_iface_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_ctf_iface_tests -------------------------------------------------------------------------------- /tests/libtensor_dense_tensor_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_dense_tensor_tests -------------------------------------------------------------------------------- /tests/libtensor_diag_block_tensor_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_diag_block_tensor_tests -------------------------------------------------------------------------------- /tests/libtensor_diag_tensor_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_diag_tensor_tests -------------------------------------------------------------------------------- /tests/libtensor_expr_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_expr_tests -------------------------------------------------------------------------------- /tests/libtensor_iface_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_iface_tests -------------------------------------------------------------------------------- /tests/libtensor_symmetry_tests: -------------------------------------------------------------------------------- 1 | ../build/tests/libtensor_symmetry_tests -------------------------------------------------------------------------------- /tests/linalg/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TESTS 2 | linalg_add_i_i_x_x_test 3 | linalg_copy_ij_ji_test 4 | linalg_mul2_i_i_i_x_test 5 | linalg_mul2_i_ip_p_x_test 6 | linalg_mul2_i_ipq_qp_x_test 7 | linalg_mul2_i_i_x_test 8 | linalg_mul2_ij_i_j_x_test 9 | linalg_mul2_ij_ip_jp_x_test 10 | linalg_mul2_ij_ip_pj_x_test 11 | linalg_mul2_ij_pi_jp_x_test 12 | linalg_mul2_ij_pi_pj_x_test 13 | linalg_mul2_i_pi_p_x_test 14 | linalg_mul2_x_p_p_test 15 | linalg_mul2_x_pq_pq_test 16 | linalg_mul2_x_pq_qp_test 17 | ) 18 | 19 | libtensor_add_tests(linalg ${TESTS}) 20 | 21 | -------------------------------------------------------------------------------- /tests/linalg/test_utils.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../test_utils.h" 3 | 4 | bool cmp(double diff, double ref) { 5 | 6 | const double k_thresh = 1e-12; 7 | 8 | if(fabs(ref) > 1.0) return fabs(diff) < fabs(ref) * k_thresh; 9 | else return fabs(diff) < k_thresh; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/symmetry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TESTS 2 | adjacency_list_test 3 | ) 4 | 5 | libtensor_add_tests(symmetry ${TESTS}) 6 | 7 | -------------------------------------------------------------------------------- /tests/symmetry/adjacency_list_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_ADJACENCY_LIST_TEST_H 2 | #define LIBTENSOR_ADJACENCY_LIST_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::adjacency_list class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class adjacency_list_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | void test_3() throw(libtest::test_exception); 20 | void test_4() throw(libtest::test_exception); 21 | }; 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_ADJACENCY_LIST_TEST_H 26 | 27 | -------------------------------------------------------------------------------- /tests/symmetry/er_optimize_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_ER_OPTIMIZE_TEST_H 2 | #define LIBTENSOR_ER_OPTIMIZE_TEST_H 3 | 4 | #include "se_label_test_base.h" 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::er_optimize class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class er_optimize_test : public se_label_test_base { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1(const std::string &id) throw(libtest::test_exception); 18 | void test_2(const std::string &id) throw(libtest::test_exception); 19 | void test_3(const std::string &id) throw(libtest::test_exception); 20 | }; 21 | 22 | } // namespace libtensor 23 | 24 | #endif // LIBTENSOR_ER_OPTIMIZE_TEST_H 25 | 26 | -------------------------------------------------------------------------------- /tests/symmetry/eval_sequence_list_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EVAL_SEQUENCE_LIST_TEST_H 2 | #define LIBTENSOR_EVAL_SEQUENCE_LIST_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::evaluation_rule class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class eval_sequence_list_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | }; 19 | 20 | } // namespace libtensor 21 | 22 | #endif // LIBTENSOR_EVAL_SEQUENCE_LIST_TEST_H 23 | 24 | -------------------------------------------------------------------------------- /tests/symmetry/evaluation_rule_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_EVALUATION_RULE_TEST_H 2 | #define LIBTENSOR_EVALUATION_RULE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::evaluation_rule class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class evaluation_rule_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_copy_1() throw(libtest::test_exception); 19 | }; 20 | 21 | } // namespace libtensor 22 | 23 | #endif // LIBTENSOR_EVALUATION_RULE_TEST_H 24 | 25 | -------------------------------------------------------------------------------- /tests/symmetry/point_group_table_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_POINT_GROUP_TABLE_TEST_H 2 | #define LIBTENSOR_POINT_GROUP_TABLE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::point_group_table class 10 | 11 | \ingroup libtensor_tests_sym 12 | **/ 13 | class point_group_table_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2() throw(libtest::test_exception); 20 | void test_3() throw(libtest::test_exception); 21 | void test_4() throw(libtest::test_exception); 22 | }; 23 | 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_POINT_GROUP_TABLE_TEST_H 28 | -------------------------------------------------------------------------------- /tests/symmetry/product_rule_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_PRODUCT_RULE_TEST_H 2 | #define LIBTENSOR_PRODUCT_RULE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::product_rule class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class product_rule_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | void test_3() throw(libtest::test_exception); 20 | }; 21 | 22 | } // namespace libtensor 23 | 24 | #endif // LIBTENSOR_PRODUCT_RULE_TEST_H 25 | 26 | -------------------------------------------------------------------------------- /tests/symmetry/product_table_container_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_PRODUCT_TABLE_CONTAINER_TEST_H 2 | #define LIBTENSOR_PRODUCT_TABLE_CONTAINER_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::product_table_container class 10 | 11 | \ingroup libtensor_tests_sym 12 | **/ 13 | class product_table_container_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2() throw(libtest::test_exception); 20 | void test_3() throw(libtest::test_exception); 21 | }; 22 | 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_PRODUCT_TABLE_CONTAINER_TEST_H 27 | -------------------------------------------------------------------------------- /tests/symmetry/so_copy_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SO_COPY_TEST_H 2 | #define LIBTENSOR_SO_COPY_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::so_copy class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class so_copy_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | void test_3() throw(libtest::test_exception); 20 | 21 | }; 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_SO_COPY_TEST_H 26 | -------------------------------------------------------------------------------- /tests/symmetry/so_merge_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SO_MERGE_TEST_H 2 | #define LIBTENSOR_SO_MERGE_TEST_H 3 | 4 | #include "se_label_test_base.h" 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::so_merge class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class so_merge_test : public se_label_test_base { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | void test_3() throw(libtest::test_exception); 20 | void test_4() throw(libtest::test_exception); 21 | void test_5() throw(libtest::test_exception); 22 | 23 | }; 24 | 25 | } // namespace libtensor 26 | 27 | #endif // LIBTENSOR_SO_MERGE_TEST_H 28 | -------------------------------------------------------------------------------- /tests/symmetry/so_permute_se_part_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SO_PERMUTE_SE_PART_TEST_H 2 | #define LIBTENSOR_SO_PERMUTE_SE_PART_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::so_permute_se_part class 10 | 11 | \ingroup libtensor_tests_sym 12 | **/ 13 | class so_permute_se_part_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | void test_2a() throw(libtest::test_exception); 20 | void test_2b() throw(libtest::test_exception); 21 | void test_3() throw(libtest::test_exception); 22 | 23 | }; 24 | 25 | 26 | } // namespace libtensor 27 | 28 | #endif // LIBTENSOR_SO_PERMUTE_SE_PART_TEST_H 29 | -------------------------------------------------------------------------------- /tests/symmetry/so_permute_se_perm_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SO_PERMUTE_SE_PERM_TEST_H 2 | #define LIBTENSOR_SO_PERMUTE_SE_PERM_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | 9 | /** \brief Tests the libtensor::so_permute_se_perm class 10 | 11 | \ingroup libtensor_tests_sym 12 | **/ 13 | class so_permute_se_perm_test : public libtest::unit_test { 14 | public: 15 | virtual void perform() throw(libtest::test_exception); 16 | 17 | private: 18 | void test_1() throw(libtest::test_exception); 19 | 20 | }; 21 | 22 | 23 | } // namespace libtensor 24 | 25 | #endif // LIBTENSOR_SO_PERMUTE_SE_PERM_TEST_H 26 | -------------------------------------------------------------------------------- /tests/symmetry/so_reduce_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SO_REDUCE_TEST_H 2 | #define LIBTENSOR_SO_REDUCE_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::so_reduce class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class so_reduce_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | void test_3() throw(libtest::test_exception); 20 | void test_4() throw(libtest::test_exception); 21 | 22 | }; 23 | 24 | } // namespace libtensor 25 | 26 | #endif // LIBTENSOR_SO_REDUCE_TEST_H 27 | -------------------------------------------------------------------------------- /tests/symmetry/symmetry_element_set_adapter_test.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTENSOR_SYMMETRY_ELEMENT_SET_ADAPTER_TEST_H 2 | #define LIBTENSOR_SYMMETRY_ELEMENT_SET_ADAPTER_TEST_H 3 | 4 | #include 5 | 6 | namespace libtensor { 7 | 8 | /** \brief Tests the libtensor::symmetry_element_set_adapter class 9 | 10 | \ingroup libtensor_tests_sym 11 | **/ 12 | class symmetry_element_set_adapter_test : public libtest::unit_test { 13 | public: 14 | virtual void perform() throw(libtest::test_exception); 15 | 16 | private: 17 | void test_1() throw(libtest::test_exception); 18 | void test_2() throw(libtest::test_exception); 19 | 20 | }; 21 | 22 | } // namespace libtensor 23 | 24 | #endif // LIBTENSOR_SYMMETRY_ELEMENT_SET_ADAPTER_TEST_H 25 | -------------------------------------------------------------------------------- /tests/test_utils.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int fail_test( 4 | const std::string &testname, const std::string &source, unsigned lineno, 5 | const std::string &error) { 6 | 7 | std::cout << testname << std::endl << source << ":" << lineno << std::endl 8 | << error << std::endl << std::endl; 9 | return 1; 10 | } 11 | 12 | --------------------------------------------------------------------------------