├── .gitattributes
├── .gitignore
├── BatchProcess
├── BatchProcess.vcxproj
├── BatchProcess.vcxproj.filters
├── BatchProcess.vcxproj.user
└── main.cpp
├── CloudOptimization
├── CCloudOptimization.cpp
├── CCloudOptimization.h
├── CloudOptimization.vcxproj
├── CloudOptimization.vcxproj.filters
├── CloudOptimization.vcxproj.user
├── my_ply_interface.cpp
├── my_ply_interface.h
├── rply.c
└── rply.h
├── Demo
├── PoissonRecon.x64.exe
├── Remesh.exe
├── SurfaceTrimmer.x64.exe
├── TextureStitcher.exe
├── mesh.bat
├── meshlab.bat
├── meshlab
│ ├── decimation.mlx
│ ├── empty.mlx
│ ├── script1.mlx
│ ├── script2.mlx
│ ├── script4color.mlx
│ └── subdiv.mlx
├── scans.txt
├── segmentation
│ ├── CutImageDir.m
│ ├── CutImageDir_canon.m
│ ├── RegionGrowing.m
│ └── RegionGrowing_mex.cpp
└── vcomp100.dll
├── Kinect2Cloud
├── CKinect2Cloud.cpp
├── CKinect2Cloud.h
├── Kinect2Cloud.vcxproj
├── Kinect2Cloud.vcxproj.filters
├── Kinect2Cloud.vcxproj.user
└── main.cpp
├── Readme.md
├── include
├── armadillo
│ ├── armadillo
│ ├── armadillo_bits
│ │ ├── BaseCube_bones.hpp
│ │ ├── BaseCube_meat.hpp
│ │ ├── Base_bones.hpp
│ │ ├── Base_meat.hpp
│ │ ├── Col_bones.hpp
│ │ ├── Col_meat.hpp
│ │ ├── Cube_bones.hpp
│ │ ├── Cube_meat.hpp
│ │ ├── GenCube_bones.hpp
│ │ ├── GenCube_meat.hpp
│ │ ├── Gen_bones.hpp
│ │ ├── Gen_meat.hpp
│ │ ├── GlueCube_bones.hpp
│ │ ├── GlueCube_meat.hpp
│ │ ├── Glue_bones.hpp
│ │ ├── Glue_meat.hpp
│ │ ├── Mat_bones.hpp
│ │ ├── Mat_meat.hpp
│ │ ├── OpCube_bones.hpp
│ │ ├── OpCube_meat.hpp
│ │ ├── Op_bones.hpp
│ │ ├── Op_meat.hpp
│ │ ├── Proxy.hpp
│ │ ├── ProxyCube.hpp
│ │ ├── Row_bones.hpp
│ │ ├── Row_meat.hpp
│ │ ├── SizeCube_bones.hpp
│ │ ├── SizeCube_meat.hpp
│ │ ├── SizeMat_bones.hpp
│ │ ├── SizeMat_meat.hpp
│ │ ├── SpBase_bones.hpp
│ │ ├── SpBase_meat.hpp
│ │ ├── SpCol_bones.hpp
│ │ ├── SpCol_meat.hpp
│ │ ├── SpGlue_bones.hpp
│ │ ├── SpGlue_meat.hpp
│ │ ├── SpMat_bones.hpp
│ │ ├── SpMat_iterators_meat.hpp
│ │ ├── SpMat_meat.hpp
│ │ ├── SpOp_bones.hpp
│ │ ├── SpOp_meat.hpp
│ │ ├── SpProxy.hpp
│ │ ├── SpRow_bones.hpp
│ │ ├── SpRow_meat.hpp
│ │ ├── SpSubview_bones.hpp
│ │ ├── SpSubview_iterators_meat.hpp
│ │ ├── SpSubview_meat.hpp
│ │ ├── SpValProxy_bones.hpp
│ │ ├── SpValProxy_meat.hpp
│ │ ├── access.hpp
│ │ ├── arma_boost.hpp
│ │ ├── arma_cmath.hpp
│ │ ├── arma_config.hpp
│ │ ├── arma_ostream_bones.hpp
│ │ ├── arma_ostream_meat.hpp
│ │ ├── arma_rng.hpp
│ │ ├── arma_rng_cxx11.hpp
│ │ ├── arma_rng_cxx98.hpp
│ │ ├── arma_static_check.hpp
│ │ ├── arma_version.hpp
│ │ ├── arpack_bones.hpp
│ │ ├── arpack_wrapper.hpp
│ │ ├── arrayops_bones.hpp
│ │ ├── arrayops_meat.hpp
│ │ ├── atlas_bones.hpp
│ │ ├── atlas_wrapper.hpp
│ │ ├── auxlib_bones.hpp
│ │ ├── auxlib_meat.hpp
│ │ ├── blas_bones.hpp
│ │ ├── blas_wrapper.hpp
│ │ ├── compiler_setup.hpp
│ │ ├── compiler_setup_post.hpp
│ │ ├── cond_rel_bones.hpp
│ │ ├── cond_rel_meat.hpp
│ │ ├── config.hpp
│ │ ├── config.hpp.cmake
│ │ ├── constants.hpp
│ │ ├── constants_compat.hpp
│ │ ├── debug.hpp
│ │ ├── diagmat_proxy.hpp
│ │ ├── diagview_bones.hpp
│ │ ├── diagview_meat.hpp
│ │ ├── diskio_bones.hpp
│ │ ├── diskio_meat.hpp
│ │ ├── distr_param.hpp
│ │ ├── eGlueCube_bones.hpp
│ │ ├── eGlueCube_meat.hpp
│ │ ├── eGlue_bones.hpp
│ │ ├── eGlue_meat.hpp
│ │ ├── eOpCube_bones.hpp
│ │ ├── eOpCube_meat.hpp
│ │ ├── eOp_bones.hpp
│ │ ├── eOp_meat.hpp
│ │ ├── eglue_core_bones.hpp
│ │ ├── eglue_core_meat.hpp
│ │ ├── eop_aux.hpp
│ │ ├── eop_core_bones.hpp
│ │ ├── eop_core_meat.hpp
│ │ ├── fft_engine.hpp
│ │ ├── field_bones.hpp
│ │ ├── field_meat.hpp
│ │ ├── fn_accu.hpp
│ │ ├── fn_all.hpp
│ │ ├── fn_any.hpp
│ │ ├── fn_as_scalar.hpp
│ │ ├── fn_chol.hpp
│ │ ├── fn_cond.hpp
│ │ ├── fn_conv.hpp
│ │ ├── fn_conv_to.hpp
│ │ ├── fn_cor.hpp
│ │ ├── fn_cov.hpp
│ │ ├── fn_cross.hpp
│ │ ├── fn_cumsum.hpp
│ │ ├── fn_det.hpp
│ │ ├── fn_diagmat.hpp
│ │ ├── fn_diagvec.hpp
│ │ ├── fn_dot.hpp
│ │ ├── fn_eig_gen.hpp
│ │ ├── fn_eig_pair.hpp
│ │ ├── fn_eig_sym.hpp
│ │ ├── fn_eigs_gen.hpp
│ │ ├── fn_eigs_sym.hpp
│ │ ├── fn_elem.hpp
│ │ ├── fn_eps.hpp
│ │ ├── fn_eye.hpp
│ │ ├── fn_fft.hpp
│ │ ├── fn_fft2.hpp
│ │ ├── fn_find.hpp
│ │ ├── fn_flip.hpp
│ │ ├── fn_hist.hpp
│ │ ├── fn_histc.hpp
│ │ ├── fn_inplace_strans.hpp
│ │ ├── fn_inplace_trans.hpp
│ │ ├── fn_inv.hpp
│ │ ├── fn_join.hpp
│ │ ├── fn_kron.hpp
│ │ ├── fn_log_det.hpp
│ │ ├── fn_lu.hpp
│ │ ├── fn_max.hpp
│ │ ├── fn_mean.hpp
│ │ ├── fn_median.hpp
│ │ ├── fn_min.hpp
│ │ ├── fn_misc.hpp
│ │ ├── fn_n_unique.hpp
│ │ ├── fn_norm.hpp
│ │ ├── fn_norm_sparse.hpp
│ │ ├── fn_normalise.hpp
│ │ ├── fn_numel.hpp
│ │ ├── fn_ones.hpp
│ │ ├── fn_pinv.hpp
│ │ ├── fn_princomp.hpp
│ │ ├── fn_prod.hpp
│ │ ├── fn_qr.hpp
│ │ ├── fn_randi.hpp
│ │ ├── fn_randn.hpp
│ │ ├── fn_randu.hpp
│ │ ├── fn_rank.hpp
│ │ ├── fn_repmat.hpp
│ │ ├── fn_reshape.hpp
│ │ ├── fn_resize.hpp
│ │ ├── fn_shuffle.hpp
│ │ ├── fn_size.hpp
│ │ ├── fn_solve.hpp
│ │ ├── fn_sort.hpp
│ │ ├── fn_sort_index.hpp
│ │ ├── fn_speye.hpp
│ │ ├── fn_spones.hpp
│ │ ├── fn_sprandn.hpp
│ │ ├── fn_sprandu.hpp
│ │ ├── fn_stddev.hpp
│ │ ├── fn_strans.hpp
│ │ ├── fn_sum.hpp
│ │ ├── fn_svd.hpp
│ │ ├── fn_syl_lyap.hpp
│ │ ├── fn_symmat.hpp
│ │ ├── fn_toeplitz.hpp
│ │ ├── fn_trace.hpp
│ │ ├── fn_trans.hpp
│ │ ├── fn_trig.hpp
│ │ ├── fn_trimat.hpp
│ │ ├── fn_trunc_exp.hpp
│ │ ├── fn_trunc_log.hpp
│ │ ├── fn_unique.hpp
│ │ ├── fn_var.hpp
│ │ ├── fn_vectorise.hpp
│ │ ├── fn_zeros.hpp
│ │ ├── forward_bones.hpp
│ │ ├── glue_conv_bones.hpp
│ │ ├── glue_conv_meat.hpp
│ │ ├── glue_cor_bones.hpp
│ │ ├── glue_cor_meat.hpp
│ │ ├── glue_cov_bones.hpp
│ │ ├── glue_cov_meat.hpp
│ │ ├── glue_cross_bones.hpp
│ │ ├── glue_cross_meat.hpp
│ │ ├── glue_hist_bones.hpp
│ │ ├── glue_hist_meat.hpp
│ │ ├── glue_histc_bones.hpp
│ │ ├── glue_histc_meat.hpp
│ │ ├── glue_join_bones.hpp
│ │ ├── glue_join_meat.hpp
│ │ ├── glue_kron_bones.hpp
│ │ ├── glue_kron_meat.hpp
│ │ ├── glue_max_bones.hpp
│ │ ├── glue_max_meat.hpp
│ │ ├── glue_min_bones.hpp
│ │ ├── glue_min_meat.hpp
│ │ ├── glue_mixed_bones.hpp
│ │ ├── glue_mixed_meat.hpp
│ │ ├── glue_relational_bones.hpp
│ │ ├── glue_relational_meat.hpp
│ │ ├── glue_solve_bones.hpp
│ │ ├── glue_solve_meat.hpp
│ │ ├── glue_times_bones.hpp
│ │ ├── glue_times_meat.hpp
│ │ ├── glue_toeplitz_bones.hpp
│ │ ├── glue_toeplitz_meat.hpp
│ │ ├── hdf5_misc.hpp
│ │ ├── include_atlas.hpp
│ │ ├── injector_bones.hpp
│ │ ├── injector_meat.hpp
│ │ ├── lapack_bones.hpp
│ │ ├── lapack_wrapper.hpp
│ │ ├── memory.hpp
│ │ ├── mtGlueCube_bones.hpp
│ │ ├── mtGlueCube_meat.hpp
│ │ ├── mtGlue_bones.hpp
│ │ ├── mtGlue_meat.hpp
│ │ ├── mtOpCube_bones.hpp
│ │ ├── mtOpCube_meat.hpp
│ │ ├── mtOp_bones.hpp
│ │ ├── mtOp_meat.hpp
│ │ ├── mtSpOp_bones.hpp
│ │ ├── mtSpOp_meat.hpp
│ │ ├── mul_gemm.hpp
│ │ ├── mul_gemm_mixed.hpp
│ │ ├── mul_gemv.hpp
│ │ ├── mul_herk.hpp
│ │ ├── mul_syrk.hpp
│ │ ├── op_all_bones.hpp
│ │ ├── op_all_meat.hpp
│ │ ├── op_any_bones.hpp
│ │ ├── op_any_meat.hpp
│ │ ├── op_chol_bones.hpp
│ │ ├── op_chol_meat.hpp
│ │ ├── op_cor_bones.hpp
│ │ ├── op_cor_meat.hpp
│ │ ├── op_cov_bones.hpp
│ │ ├── op_cov_meat.hpp
│ │ ├── op_cumsum_bones.hpp
│ │ ├── op_cumsum_meat.hpp
│ │ ├── op_cx_scalar_bones.hpp
│ │ ├── op_cx_scalar_meat.hpp
│ │ ├── op_diagmat_bones.hpp
│ │ ├── op_diagmat_meat.hpp
│ │ ├── op_diagvec_bones.hpp
│ │ ├── op_diagvec_meat.hpp
│ │ ├── op_dot_bones.hpp
│ │ ├── op_dot_meat.hpp
│ │ ├── op_dotext_bones.hpp
│ │ ├── op_dotext_meat.hpp
│ │ ├── op_fft_bones.hpp
│ │ ├── op_fft_meat.hpp
│ │ ├── op_find_bones.hpp
│ │ ├── op_find_meat.hpp
│ │ ├── op_flip_bones.hpp
│ │ ├── op_flip_meat.hpp
│ │ ├── op_hist_bones.hpp
│ │ ├── op_hist_meat.hpp
│ │ ├── op_htrans_bones.hpp
│ │ ├── op_htrans_meat.hpp
│ │ ├── op_inv_bones.hpp
│ │ ├── op_inv_meat.hpp
│ │ ├── op_max_bones.hpp
│ │ ├── op_max_meat.hpp
│ │ ├── op_mean_bones.hpp
│ │ ├── op_mean_meat.hpp
│ │ ├── op_median_bones.hpp
│ │ ├── op_median_meat.hpp
│ │ ├── op_min_bones.hpp
│ │ ├── op_min_meat.hpp
│ │ ├── op_misc_bones.hpp
│ │ ├── op_misc_meat.hpp
│ │ ├── op_normalise_bones.hpp
│ │ ├── op_normalise_meat.hpp
│ │ ├── op_pinv_bones.hpp
│ │ ├── op_pinv_meat.hpp
│ │ ├── op_princomp_bones.hpp
│ │ ├── op_princomp_meat.hpp
│ │ ├── op_prod_bones.hpp
│ │ ├── op_prod_meat.hpp
│ │ ├── op_relational_bones.hpp
│ │ ├── op_relational_meat.hpp
│ │ ├── op_repmat_bones.hpp
│ │ ├── op_repmat_meat.hpp
│ │ ├── op_reshape_bones.hpp
│ │ ├── op_reshape_meat.hpp
│ │ ├── op_resize_bones.hpp
│ │ ├── op_resize_meat.hpp
│ │ ├── op_shuffle_bones.hpp
│ │ ├── op_shuffle_meat.hpp
│ │ ├── op_sort_bones.hpp
│ │ ├── op_sort_meat.hpp
│ │ ├── op_stddev_bones.hpp
│ │ ├── op_stddev_meat.hpp
│ │ ├── op_strans_bones.hpp
│ │ ├── op_strans_meat.hpp
│ │ ├── op_sum_bones.hpp
│ │ ├── op_sum_meat.hpp
│ │ ├── op_symmat_bones.hpp
│ │ ├── op_symmat_meat.hpp
│ │ ├── op_toeplitz_bones.hpp
│ │ ├── op_toeplitz_meat.hpp
│ │ ├── op_trimat_bones.hpp
│ │ ├── op_trimat_meat.hpp
│ │ ├── op_unique_bones.hpp
│ │ ├── op_unique_meat.hpp
│ │ ├── op_var_bones.hpp
│ │ ├── op_var_meat.hpp
│ │ ├── op_vectorise_bones.hpp
│ │ ├── op_vectorise_meat.hpp
│ │ ├── operator_cube_div.hpp
│ │ ├── operator_cube_minus.hpp
│ │ ├── operator_cube_plus.hpp
│ │ ├── operator_cube_relational.hpp
│ │ ├── operator_cube_schur.hpp
│ │ ├── operator_cube_times.hpp
│ │ ├── operator_div.hpp
│ │ ├── operator_minus.hpp
│ │ ├── operator_ostream.hpp
│ │ ├── operator_plus.hpp
│ │ ├── operator_relational.hpp
│ │ ├── operator_schur.hpp
│ │ ├── operator_times.hpp
│ │ ├── podarray_bones.hpp
│ │ ├── podarray_meat.hpp
│ │ ├── promote_type.hpp
│ │ ├── restrictors.hpp
│ │ ├── running_stat_bones.hpp
│ │ ├── running_stat_meat.hpp
│ │ ├── running_stat_vec_bones.hpp
│ │ ├── running_stat_vec_meat.hpp
│ │ ├── sp_auxlib_bones.hpp
│ │ ├── sp_auxlib_meat.hpp
│ │ ├── span.hpp
│ │ ├── spglue_minus_bones.hpp
│ │ ├── spglue_minus_meat.hpp
│ │ ├── spglue_plus_bones.hpp
│ │ ├── spglue_plus_meat.hpp
│ │ ├── spglue_times_bones.hpp
│ │ ├── spglue_times_meat.hpp
│ │ ├── spop_htrans_bones.hpp
│ │ ├── spop_htrans_meat.hpp
│ │ ├── spop_max_bones.hpp
│ │ ├── spop_max_meat.hpp
│ │ ├── spop_mean_bones.hpp
│ │ ├── spop_mean_meat.hpp
│ │ ├── spop_min_bones.hpp
│ │ ├── spop_min_meat.hpp
│ │ ├── spop_misc_bones.hpp
│ │ ├── spop_misc_meat.hpp
│ │ ├── spop_strans_bones.hpp
│ │ ├── spop_strans_meat.hpp
│ │ ├── spop_sum_bones.hpp
│ │ ├── spop_sum_meat.hpp
│ │ ├── spop_var_bones.hpp
│ │ ├── spop_var_meat.hpp
│ │ ├── strip.hpp
│ │ ├── subview_bones.hpp
│ │ ├── subview_cube_bones.hpp
│ │ ├── subview_cube_meat.hpp
│ │ ├── subview_each_bones.hpp
│ │ ├── subview_each_meat.hpp
│ │ ├── subview_elem1_bones.hpp
│ │ ├── subview_elem1_meat.hpp
│ │ ├── subview_elem2_bones.hpp
│ │ ├── subview_elem2_meat.hpp
│ │ ├── subview_field_bones.hpp
│ │ ├── subview_field_meat.hpp
│ │ ├── subview_meat.hpp
│ │ ├── traits.hpp
│ │ ├── typedef_elem.hpp
│ │ ├── typedef_elem_check.hpp
│ │ ├── typedef_mat.hpp
│ │ ├── typedef_mat_fixed.hpp
│ │ ├── unwrap.hpp
│ │ ├── unwrap_cube.hpp
│ │ ├── unwrap_spmat.hpp
│ │ ├── upgrade_val.hpp
│ │ ├── wall_clock_bones.hpp
│ │ ├── wall_clock_meat.hpp
│ │ ├── xvec_htrans_bones.hpp
│ │ └── xvec_htrans_meat.hpp
│ ├── cblas.h
│ ├── f77blas.h
│ ├── lapacke.h
│ ├── lapacke_config.h
│ ├── lapacke_mangling.h
│ ├── lapacke_utils.h
│ └── openblas_config.h
└── opencv
│ ├── calib3d.hpp
│ ├── config.h
│ ├── core.hpp
│ ├── core_c.h
│ ├── defines.h
│ ├── eigen.hpp
│ ├── features2d.hpp
│ ├── highgui.hpp
│ ├── highgui_c.h
│ ├── imgproc.hpp
│ ├── imgproc_c.h
│ ├── mat.hpp
│ ├── miniflann.hpp
│ ├── operations.hpp
│ ├── types_c_core.h
│ ├── types_c_imgproc.h
│ └── version.hpp
├── lib
└── opencv.7z
├── reconstruction.sln
└── reconstruction
├── CManageData.cpp
├── CManageData.h
├── CReconstruction.cpp
├── CReconstruction.h
├── CStereoMatching.cpp
├── CStereoMatching.h
├── SharedInclude.h
├── main.cpp
├── reconstruction.vcxproj
├── reconstruction.vcxproj.filters
└── reconstruction.vcxproj.user
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #common files
2 | *.svn-base
3 | reconstruction/x64/
4 | CloudOptimization/x64/
5 | Kinect2Cloud/x64/
6 | BatchProcess/x64/
7 | lib/opencv/
8 | Demo/INPUT/
9 | Demo/tmp/
10 | Demo/meshlab/
11 | Demo/unused/
12 | Demo/matlab_files/
13 | Demo/unused/
14 | .svn/
15 |
16 | # Compiled Object files
17 | *.slo
18 | *.lo
19 | *.o
20 | *.obj
21 | *.ipch
22 | *.pdb
23 | *.exp
24 | *.suo
25 | *.opensdf
26 | *.sdf
27 |
28 |
29 |
30 | # Compiled Dynamic libraries
31 | *.so
32 | *.dylib
33 | #*.dll
34 |
35 | # Fortran module files
36 | *.mod
37 |
38 | # Compiled Static libraries
39 | *.lai
40 | *.la
41 | *.a
42 | #*.lib
43 |
44 | # Executables
45 | #*.exe
46 | *.out
47 | *.app
48 |
49 | # =========================
50 | # Operating System Files
51 | # =========================
52 |
53 | # OSX
54 | # =========================
55 |
56 | .DS_Store
57 | .AppleDouble
58 | .LSOverride
59 |
60 | # Icon must end with two \r
61 | Icon
62 |
63 | # Thumbnails
64 | ._*
65 |
66 | # Files that might appear on external disk
67 | .Spotlight-V100
68 | .Trashes
69 |
70 | # Directories potentially created on remote AFP share
71 | .AppleDB
72 | .AppleDesktop
73 | Network Trash Folder
74 | Temporary Items
75 | .apdisk
76 |
77 | # Windows
78 | # =========================
79 |
80 | # Windows image file caches
81 | Thumbs.db
82 | ehthumbs.db
83 |
84 | # Folder config file
85 | Desktop.ini
86 |
87 | # Recycle Bin used on file shares
88 | $RECYCLE.BIN/
89 |
90 | # Windows Installer files
91 | *.cab
92 | *.msi
93 | *.msm
94 | *.msp
95 |
96 | Demo/readme.txt
97 | Demo/segmentation/main_ljl_5_18.m
98 | Demo/segmentation/RegionGrowing_mex.mexw64
99 | Demo/CloudOptimization_Release.dll
100 | Demo/reconstruction.exe
101 | lib/CloudOptimization_Release.lib
--------------------------------------------------------------------------------
/BatchProcess/BatchProcess.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | 源文件
20 |
21 |
22 |
--------------------------------------------------------------------------------
/BatchProcess/BatchProcess.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(SolutionDir)dlls\$(Configuration)
5 | WindowsLocalDebugger
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CloudOptimization/CCloudOptimization.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seed93/reconstruction/984d4139bb84e424b2e359e6af5985cdf3782a78/CloudOptimization/CCloudOptimization.cpp
--------------------------------------------------------------------------------
/CloudOptimization/CCloudOptimization.h:
--------------------------------------------------------------------------------
1 | #ifndef CCloudOptimization_h
2 | #define CCloudOptimization_h
3 | #define _CRT_SECURE_NO_WARNINGS
4 | #include
5 | #include
6 | #include
7 | #include
8 | //#include
9 | #include
10 | //#include
11 | #include
12 | //#include
13 | //#include
14 | //#include
15 | //#include
16 | #include
17 |
18 | #include
19 | #include "../reconstruction/CManageData.h"
20 |
21 |
22 | #ifdef _DEBUG
23 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_common_debug.lib")
24 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_kdtree_debug.lib")
25 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_io_debug.lib")
26 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_io_ply_debug.lib")
27 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_surface_debug.lib")
28 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_features_debug.lib")
29 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_search_debug.lib")
30 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_filters_debug.lib")
31 | #else
32 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_common_release.lib")
33 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_kdtree_release.lib")
34 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_io_release.lib")
35 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_io_ply_release.lib")
36 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_surface_release.lib")
37 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_features_release.lib")
38 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_search_release.lib")
39 | #pragma comment (lib, "../../PCL_1_6_0/lib/pcl_filters_release.lib")
40 | #endif
41 |
42 |
43 | #endif
--------------------------------------------------------------------------------
/CloudOptimization/CloudOptimization.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | 头文件
20 |
21 |
22 | 头文件
23 |
24 |
25 | 头文件
26 |
27 |
28 | 头文件
29 |
30 |
31 |
32 |
33 | 源文件
34 |
35 |
36 | 源文件
37 |
38 |
39 | 源文件
40 |
41 |
42 |
--------------------------------------------------------------------------------
/CloudOptimization/CloudOptimization.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WindowsLocalDebugger
7 |
8 |
9 |
10 |
11 | WindowsLocalDebugger
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/CloudOptimization/my_ply_interface.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "rply.h"
3 |
4 | class MyPlyIo
5 | {
6 | public:
7 | MyPlyIo(void(*getRgb)(float x, float y, float z, unsigned char rgb[]), char mode) :
8 | m_getRgb(getRgb), m_Mode(mode == 'a' ? PLY_ASCII : PLY_LITTLE_ENDIAN) {};
9 | int ReadAndWrite(char input[], char output[]);
10 |
11 | private:
12 | void(*m_getRgb)(float x, float y, float z, unsigned char rgb[]);
13 | e_ply_storage_mode m_Mode;
14 | };
--------------------------------------------------------------------------------
/Demo/PoissonRecon.x64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seed93/reconstruction/984d4139bb84e424b2e359e6af5985cdf3782a78/Demo/PoissonRecon.x64.exe
--------------------------------------------------------------------------------
/Demo/Remesh.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seed93/reconstruction/984d4139bb84e424b2e359e6af5985cdf3782a78/Demo/Remesh.exe
--------------------------------------------------------------------------------
/Demo/SurfaceTrimmer.x64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seed93/reconstruction/984d4139bb84e424b2e359e6af5985cdf3782a78/Demo/SurfaceTrimmer.x64.exe
--------------------------------------------------------------------------------
/Demo/TextureStitcher.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seed93/reconstruction/984d4139bb84e424b2e359e6af5985cdf3782a78/Demo/TextureStitcher.exe
--------------------------------------------------------------------------------
/Demo/mesh.bat:
--------------------------------------------------------------------------------
1 | PoissonRecon.x64.exe --in tmp\cloud_filter.ply --out tmp\mesh.ply --depth 9 --density --samplesPerNode 2 --pointWeight 0 --solverDivide 9
2 | SurfaceTrimmer.x64.exe --in tmp\mesh.ply --out tmp\mesh_trimmer.ply --smooth 100 --trim 7 --aRatio 0.01
3 | meshlab\\meshlabserver.exe -i tmp\\mesh_trimmer.ply -o tmp\\mesh_trimmer.ply -s meshlab\\script4color.mlx
--------------------------------------------------------------------------------
/Demo/meshlab.bat:
--------------------------------------------------------------------------------
1 | meshlab\\meshlabserver.exe -i tmp\\bigcloud.ply -o tmp\\mesh.ply -s meshlab\\script1.mlx
2 | meshlab\\meshlabserver.exe -i tmp\\mesh.ply -o tmp\\bigmesh.ply -s meshlab\\script2.mlx
--------------------------------------------------------------------------------
/Demo/meshlab/empty.mlx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Demo/meshlab/script2.mlx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Demo/meshlab/script4color.mlx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Demo/meshlab/subdiv.mlx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Demo/scans.txt:
--------------------------------------------------------------------------------
1 | tmp\color111_0_0.ply
2 | tmp\color111_1_0.ply
3 | tmp\color111_2_0.ply
4 | tmp\color111_3_0.ply
5 | tmp\color111_4_0.ply
6 | tmp\color111_5_0.ply
7 | tmp\color111_6_0.ply
8 | tmp\color111_7_0.ply
9 | tmp\color111_8_0.ply
10 | tmp\color111_9_0.ply
11 | tmp\color111_0_1.ply
12 | tmp\color111_1_1.ply
13 | tmp\color111_2_1.ply
14 | tmp\color111_3_1.ply
15 | tmp\color111_4_1.ply
16 | tmp\color111_5_1.ply
17 | tmp\color111_6_1.ply
18 | tmp\color111_7_1.ply
19 | tmp\color111_8_1.ply
20 | tmp\color111_9_1.ply
--------------------------------------------------------------------------------
/Demo/segmentation/CutImageDir_canon.m:
--------------------------------------------------------------------------------
1 | function CutImageDir_canon(dir_name)
2 | mask_dir = [dir_name '/mask/'];
3 | result_dir = [dir_name '/result/'];
4 | mkdir(mask_dir);
5 | mkdir(result_dir);
6 | isrotated = ones(10,1);
7 | for j=1:10
8 | fprintf('cam %d start\n', j);
9 | bk_img = imread(sprintf('%s//0002_Cam%d.jpg', dir_name, j-1));
10 | % if isrotated(j)
11 | % bk_img = rot90(bk_img,1);
12 | % imwrite(bk_img, sprintf('%s//0002_Cam%d.jpg', dir_name, j-1));
13 | % end
14 | bk_img = imresize(bk_img,[NaN 350]);
15 | bk_img = im2double(bk_img);
16 | mean_b = mean(bk_img,3)-eps;
17 | bk_img2 = bsxfun(@minus, bk_img, mean_b);
18 | parfor i=15:20
19 | CutOneImage(sprintf('%s//%.4d_Cam%d.jpg', dir_name, i, j-1), ...
20 | bk_img2, mean_b, sprintf('%s//%.4d_Cam%d.jpg', mask_dir, i, j-1), ...
21 | sprintf('%s//%.4d_Cam%d.jpg', result_dir, i, j-1), isrotated(j));
22 | end
23 | end
24 | end
25 |
26 | function CutOneImage(img1_name,img2_,mean_img2,mask_name,temp_name,isrotated)
27 | img1 = imread(img1_name);
28 | if isrotated
29 | img1 = rot90(img1,1);
30 | imwrite(img1, img1_name, 'Quality', 80);
31 | end
32 | img1 = imresize(img1,[NaN 350]);
33 | img1 = im2double(img1);
34 | [h,w,~] = size(img1);
35 | a = bsxfun(@minus, img1, mean_img2);
36 | S = sum(a.*img2_, 3)./sqrt(sum(a.*a,3).*sum(img2_.*img2_,3));
37 | mask=im2bw(1-S,0.9);
38 | mask=logical(imfill(double(mask)));
39 | mask=imopen(mask,strel('disk',3));
40 | [I,J] = ind2sub(size((mask)),find(mask>0));
41 | x = round(sum(I)/length(I));
42 | y = round(sum(J)/length(J));
43 | [L,~]=bwlabeln(mask,4);
44 | mask = zeros(h,w);
45 | mask(L==L(x,y)) = 1;
46 | mask = logical(mask);
47 | img1 = rgb2gray(img1);
48 | img1(~mask) = 0;
49 | imwrite(img1, temp_name);
50 | mask = imresize(mask,[NaN 3456]);
51 | mask = logical(mask);
52 | imwrite(mask, mask_name);
53 | end
--------------------------------------------------------------------------------
/Demo/vcomp100.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/seed93/reconstruction/984d4139bb84e424b2e359e6af5985cdf3782a78/Demo/vcomp100.dll
--------------------------------------------------------------------------------
/Kinect2Cloud/CKinect2Cloud.h:
--------------------------------------------------------------------------------
1 | #ifndef CKinect2Cloud_H
2 | #define CKinect2Cloud_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | using namespace cv;
11 | using namespace std;
12 |
13 |
14 | #ifdef _DEBUG
15 | #pragma comment (lib,"../lib/opencv/opencv_core245d.lib")
16 | #pragma comment (lib,"../lib/opencv/opencv_highgui245d.lib")
17 | #pragma comment (lib,"../lib/opencv/zlibd.lib")
18 | #pragma comment (lib,"../lib/opencv/libpngd.lib")
19 | #pragma comment (lib,"../lib/opencv/libjpegd.lib")
20 | #pragma comment (lib,"../lib/opencv/libtiffd.lib")
21 | #pragma comment (lib,"../lib/opencv/libjasperd.lib")
22 | #pragma comment (lib,"../lib/opencv/IlmImfd.lib")
23 | #else
24 | #pragma comment (lib,"../lib/opencv/opencv_core245.lib")
25 | #pragma comment (lib,"../lib/opencv/opencv_highgui245.lib")
26 | #pragma comment (lib,"../lib/opencv/zlib.lib")
27 | #pragma comment (lib,"../lib/opencv/libpng.lib")
28 | #pragma comment (lib,"../lib/opencv/libjpeg.lib")
29 | #pragma comment (lib,"../lib/opencv/libtiff.lib")
30 | #pragma comment (lib,"../lib/opencv/libjasper.lib")
31 | #pragma comment (lib,"../lib/opencv/IlmImf.lib")
32 | #endif
33 |
34 | class CKinect2Cloud
35 | {
36 | public:
37 | CKinect2Cloud(char filename[]);
38 | void run();
39 | void convert(Mat depthmap, Mat bk, string filename, vector param, vector bbox, Mat R1t_times_R);
40 | private:
41 | FileStorage fs;
42 | };
43 |
44 |
45 | #endif
--------------------------------------------------------------------------------
/Kinect2Cloud/Kinect2Cloud.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | 源文件
20 |
21 |
22 | 源文件
23 |
24 |
25 |
26 |
27 | 头文件
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Kinect2Cloud/Kinect2Cloud.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(SolutionDir)dlls\$(Configuration)
5 | WindowsLocalDebugger
6 |
7 |
8 | $(SolutionDir)dlls\$(Configuration)
9 | WindowsLocalDebugger
10 |
11 |
--------------------------------------------------------------------------------
/Kinect2Cloud/main.cpp:
--------------------------------------------------------------------------------
1 | #include "CKinect2Cloud.h"
2 |
3 | int main(int argc, char **argv) {
4 | char config_file[100];
5 | if (argc == 1)
6 | strcpy(config_file, "filelist.yml");
7 | else strcpy(config_file, argv[1]);
8 | CKinect2Cloud Kinect2Cloud(config_file);
9 | Kinect2Cloud.run();
10 | return 0;
11 | }
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # Reconstruction
2 |
3 | Reconstruction是一个用于多视角三维重建的项目,该项目参考[Beeler10](https://graphics.ethz.ch/publications/papers/paperBee10.php)的工作完成,使用10台佳能D1200相机、6盏闪光灯同步采集,最终由算法计算得到人脸三维模型。项目有VS2010和VS2015两个版本。
4 |
5 | # 项目依赖
6 |
7 | - [PCL](http://pointclouds.org/) 静态库。由于库文件过于庞大,未包含在项目中,需要额外下载本人已编译好的[静态库](http://pan.baidu.com/s/1bnyfvLt),有精简版(仅包含该项目所需)和完整版,解压至项目同一级目录,VS2010使用1.6.0版本,VS2015使用1.7.2版本。请用户自行编译。
8 | - OpenCV静态库,已包含在项目中,请在`lib\`目录下解压**opencv.7z**
9 | - [Armadillo](http://arma.sourceforge.net/),已包含在项目中
10 | - [MeshLab](http://meshlab.sourceforge.net/),请用户自行下载后解压到`Demo\meshlab\`目录下
11 |
12 | 注:由于库文件体积太大,并未上传debug版,如有需要请单独索取。
13 |
14 | # 项目框架
15 |
16 | 项目分为4个模块,核心为reconstruction,完成了重建的主程序,CloudOptimization用于生成涉及PCL函数的链接库,其他两个项目为个人使用。
17 |
18 | Demo文件夹下放有已编译好的可执行文件和demo资源,可直接运行`reconstruction.exe INPUT\myself\config_myself.yml`或`reconstruction.exe INPUT\ETH\config_ETH.yml`,生成ply文件用MeshLab打开。Demo需要将解压MeshLab到`Demo\meshlab\`目录下。
19 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/BaseCube_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2014 Conrad Sanderson
2 | // Copyright (C) 2008-2014 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup BaseCube
10 | //! @{
11 |
12 |
13 |
14 | template
15 | struct BaseCube_eval_Cube
16 | {
17 | arma_inline const derived& eval() const;
18 | };
19 |
20 |
21 | template
22 | struct BaseCube_eval_expr
23 | {
24 | arma_inline Cube eval() const; //!< force the immediate evaluation of a delayed expression
25 | };
26 |
27 |
28 | template
29 | struct BaseCube_eval {};
30 |
31 | template
32 | struct BaseCube_eval { typedef BaseCube_eval_Cube result; };
33 |
34 | template
35 | struct BaseCube_eval { typedef BaseCube_eval_expr result; };
36 |
37 |
38 |
39 | //! Analog of the Base class, intended for cubes
40 | template
41 | struct BaseCube
42 | : public BaseCube_eval::value>::result
43 | {
44 | arma_inline const derived& get_ref() const;
45 |
46 | inline void print(const std::string extra_text = "") const;
47 | inline void print(std::ostream& user_stream, const std::string extra_text = "") const;
48 |
49 | inline void raw_print(const std::string extra_text = "") const;
50 | inline void raw_print(std::ostream& user_stream, const std::string extra_text = "") const;
51 | };
52 |
53 |
54 |
55 | //! @}
56 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/GenCube_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2011-2013 Conrad Sanderson
2 | // Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup GenCube
10 | //! @{
11 |
12 |
13 | //! support class for generator functions (eg. zeros, randu, randn, ...)
14 | template
15 | class GenCube : public BaseCube >
16 | {
17 | public:
18 |
19 | typedef eT elem_type;
20 | typedef typename get_pod_type::result pod_type;
21 |
22 | static const bool prefer_at_accessor = false;
23 | static const bool is_simple = (is_same_type::value) || (is_same_type::value);
24 |
25 | arma_aligned const uword n_rows;
26 | arma_aligned const uword n_cols;
27 | arma_aligned const uword n_slices;
28 |
29 | arma_inline GenCube(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices);
30 | arma_inline ~GenCube();
31 |
32 | arma_inline static eT generate();
33 |
34 | arma_inline eT operator[] (const uword i) const;
35 | arma_inline eT at (const uword row, const uword col, const uword slice) const;
36 | arma_inline eT at_alt (const uword i) const;
37 |
38 | inline void apply (Cube& out) const;
39 | inline void apply_inplace_plus (Cube& out) const;
40 | inline void apply_inplace_minus(Cube& out) const;
41 | inline void apply_inplace_schur(Cube& out) const;
42 | inline void apply_inplace_div (Cube& out) const;
43 | };
44 |
45 |
46 |
47 | //! @}
48 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/Gen_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2011-2013 Conrad Sanderson
2 | // Copyright (C) 2011-2013 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup Gen
10 | //! @{
11 |
12 |
13 | //! support class for generator functions (eg. zeros, randu, randn, ...)
14 | template
15 | class Gen : public Base >
16 | {
17 | public:
18 |
19 | typedef typename T1::elem_type elem_type;
20 | typedef typename get_pod_type::result pod_type;
21 |
22 | static const bool prefer_at_accessor = (is_same_type::value) ? true : false;
23 | static const bool is_simple = (is_same_type::value) || (is_same_type::value);
24 |
25 | static const bool is_row = T1::is_row;
26 | static const bool is_col = T1::is_col;
27 |
28 | arma_aligned const uword n_rows;
29 | arma_aligned const uword n_cols;
30 |
31 | arma_inline Gen(const uword in_n_rows, const uword in_n_cols);
32 | arma_inline ~Gen();
33 |
34 | arma_inline static elem_type generate();
35 |
36 | arma_inline elem_type operator[] (const uword ii) const;
37 | arma_inline elem_type at (const uword row, const uword col) const;
38 | arma_inline elem_type at_alt (const uword ii) const;
39 |
40 | inline void apply (Mat& out) const;
41 | inline void apply_inplace_plus (Mat& out) const;
42 | inline void apply_inplace_minus(Mat& out) const;
43 | inline void apply_inplace_schur(Mat& out) const;
44 | inline void apply_inplace_div (Mat& out) const;
45 | };
46 |
47 |
48 |
49 | //! @}
50 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/GlueCube_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2010 Conrad Sanderson
2 | // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup GlueCube
10 | //! @{
11 |
12 |
13 |
14 | //! analog of the Glue class, intended for Cube objects
15 | template
16 | class GlueCube : public BaseCube >
17 | {
18 | public:
19 |
20 | typedef typename T1::elem_type elem_type;
21 | typedef typename get_pod_type::result pod_type;
22 |
23 | arma_inline GlueCube(const BaseCube& in_A, const BaseCube& in_B);
24 | arma_inline ~GlueCube();
25 |
26 | const T1& A; //!< first operand
27 | const T2& B; //!< second operand
28 |
29 | };
30 |
31 |
32 |
33 | //! @}
34 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/GlueCube_meat.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2010 Conrad Sanderson
2 | // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup GlueCube
10 | //! @{
11 |
12 |
13 |
14 | template
15 | inline
16 | GlueCube::GlueCube(const BaseCube& in_A, const BaseCube& in_B)
17 | : A(in_A.get_ref())
18 | , B(in_B.get_ref())
19 | {
20 | arma_extra_debug_sigprint();
21 | }
22 |
23 |
24 |
25 | template
26 | inline
27 | GlueCube::~GlueCube()
28 | {
29 | arma_extra_debug_sigprint();
30 | }
31 |
32 |
33 |
34 | //! @}
35 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/Glue_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2012 Conrad Sanderson
2 | // Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup Glue
10 | //! @{
11 |
12 |
13 |
14 | //! Class for storing data required for delayed binary operations,
15 | //! such as the operands (e.g. two matrices) and the binary operator (e.g. addition).
16 | //! The operands are stored as references (which can be optimised away),
17 | //! while the operator is "stored" through the template definition (glue_type).
18 | //! The operands can be 'Mat', 'Row', 'Col', 'Op', and 'Glue'.
19 | //! Note that as 'Glue' can be one of the operands, more than two matrices can be stored.
20 | //!
21 | //! For example, we could have: Glue
22 | //!
23 | //! Another example is: Glue< Op, Op, glue_times >
24 |
25 |
26 |
27 | template
28 | class Glue : public Base >
29 | {
30 | public:
31 |
32 | typedef typename T1::elem_type elem_type;
33 | typedef typename get_pod_type::result pod_type;
34 |
35 | static const bool is_row = (is_same_type::value) ? T1::is_row : false;
36 | static const bool is_col = (is_same_type::value) ? T2::is_col : false;
37 |
38 | arma_inline Glue(const T1& in_A, const T2& in_B);
39 | arma_inline Glue(const T1& in_A, const T2& in_B, const uword in_aux_uword);
40 | arma_inline ~Glue();
41 |
42 | const T1& A; //!< first operand
43 | const T2& B; //!< second operand
44 | uword aux_uword; //!< storage of auxiliary data, uword format
45 | };
46 |
47 |
48 |
49 | //! @}
50 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/Glue_meat.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2010 Conrad Sanderson
2 | // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup Glue
10 | //! @{
11 |
12 |
13 |
14 | template
15 | inline
16 | Glue::Glue(const T1& in_A, const T2& in_B)
17 | : A(in_A)
18 | , B(in_B)
19 | {
20 | arma_extra_debug_sigprint();
21 | }
22 |
23 |
24 |
25 | template
26 | inline
27 | Glue::Glue(const T1& in_A, const T2& in_B, const uword in_aux_uword)
28 | : A(in_A)
29 | , B(in_B)
30 | , aux_uword(in_aux_uword)
31 | {
32 | arma_extra_debug_sigprint();
33 | }
34 |
35 |
36 |
37 | template
38 | inline
39 | Glue::~Glue()
40 | {
41 | arma_extra_debug_sigprint();
42 | }
43 |
44 |
45 |
46 | //! @}
47 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/Op_meat.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2011 Conrad Sanderson
2 | // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup Op
10 | //! @{
11 |
12 |
13 |
14 | template
15 | inline
16 | Op::Op(const T1& in_m)
17 | : m(in_m)
18 | {
19 | arma_extra_debug_sigprint();
20 | }
21 |
22 |
23 |
24 | template
25 | inline
26 | Op::Op(const T1& in_m, const typename T1::elem_type in_aux)
27 | : m(in_m)
28 | , aux(in_aux)
29 | {
30 | arma_extra_debug_sigprint();
31 | }
32 |
33 |
34 |
35 | template
36 | inline
37 | Op::Op(const T1& in_m, const typename T1::elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uword_b)
38 | : m(in_m)
39 | , aux(in_aux)
40 | , aux_uword_a(in_aux_uword_a)
41 | , aux_uword_b(in_aux_uword_b)
42 | {
43 | arma_extra_debug_sigprint();
44 | }
45 |
46 |
47 |
48 | template
49 | inline
50 | Op::Op(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b)
51 | : m(in_m)
52 | , aux_uword_a(in_aux_uword_a)
53 | , aux_uword_b(in_aux_uword_b)
54 | {
55 | arma_extra_debug_sigprint();
56 | }
57 |
58 |
59 |
60 | template
61 | inline
62 | Op::Op(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c, const char)
63 | : m(in_m)
64 | , aux_uword_a(in_aux_uword_a)
65 | , aux_uword_b(in_aux_uword_b)
66 | , aux_uword_c(in_aux_uword_c)
67 | {
68 | arma_extra_debug_sigprint();
69 | }
70 |
71 |
72 |
73 | template
74 | inline
75 | Op::~Op()
76 | {
77 | arma_extra_debug_sigprint();
78 | }
79 |
80 |
81 |
82 | //! @}
83 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/SizeCube_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013-2014 Conrad Sanderson
2 | // Copyright (C) 2013-2014 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup SizeCube
10 | //! @{
11 |
12 |
13 |
14 | class SizeCube
15 | {
16 | public:
17 |
18 | const uword n_rows;
19 | const uword n_cols;
20 | const uword n_slices;
21 |
22 | inline SizeCube(const uword in_n_rows = 0, const uword in_n_cols = 0, const uword in_n_slices = 0);
23 |
24 | // inline operator SizeMat () const;
25 |
26 | inline bool operator==(const SizeCube& s) const;
27 | inline bool operator!=(const SizeCube& s) const;
28 |
29 | inline bool operator==(const SizeMat& s) const;
30 | inline bool operator!=(const SizeMat& s) const;
31 |
32 | inline void print(const std::string extra_text = "") const;
33 | inline void print(std::ostream& user_stream, const std::string extra_text = "") const;
34 | };
35 |
36 |
37 |
38 | //! @}
39 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/SizeMat_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013-2014 Conrad Sanderson
2 | // Copyright (C) 2013-2014 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup SizeMat
10 | //! @{
11 |
12 |
13 |
14 | class SizeMat
15 | {
16 | public:
17 |
18 | const uword n_rows;
19 | const uword n_cols;
20 |
21 | inline SizeMat(const uword in_n_rows = 0, const uword in_n_cols = 0);
22 |
23 | // inline operator SizeCube () const;
24 |
25 | inline bool operator==(const SizeMat& s) const;
26 | inline bool operator!=(const SizeMat& s) const;
27 |
28 | inline bool operator==(const SizeCube& s) const;
29 | inline bool operator!=(const SizeCube& s) const;
30 |
31 | inline void print(const std::string extra_text = "") const;
32 | inline void print(std::ostream& user_stream, const std::string extra_text = "") const;
33 | };
34 |
35 |
36 |
37 | //! @}
38 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/SpGlue_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2012 Conrad Sanderson
2 | //
3 | // This Source Code Form is subject to the terms of the Mozilla Public
4 | // License, v. 2.0. If a copy of the MPL was not distributed with this
5 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 |
7 |
8 | //! \addtogroup SpGlue
9 | //! @{
10 |
11 |
12 |
13 | template
14 | class SpGlue : public SpBase >
15 | {
16 | public:
17 |
18 | typedef typename T1::elem_type elem_type;
19 | typedef typename get_pod_type::result pod_type;
20 |
21 | static const bool is_row = ( (T1::is_row || T2::is_row) && is_spglue_elem::value ) || ( (is_spglue_times::value || is_spglue_times2::value) ? T1::is_row : false );
22 | static const bool is_col = ( (T1::is_col || T2::is_col) && is_spglue_elem::value ) || ( (is_spglue_times::value || is_spglue_times2::value) ? T2::is_col : false );
23 |
24 | arma_inline SpGlue(const T1& in_A, const T2& in_B);
25 | arma_inline SpGlue(const T1& in_A, const T2& in_B, const elem_type in_aux);
26 | arma_inline ~SpGlue();
27 |
28 | const T1& A; //!< first operand
29 | const T2& B; //!< second operand
30 | elem_type aux;
31 | };
32 |
33 |
34 |
35 | //! @}
36 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/SpGlue_meat.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2012 Conrad Sanderson
2 | //
3 | // This Source Code Form is subject to the terms of the Mozilla Public
4 | // License, v. 2.0. If a copy of the MPL was not distributed with this
5 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 |
7 |
8 | //! \addtogroup SpGlue
9 | //! @{
10 |
11 |
12 |
13 | template
14 | inline
15 | SpGlue::SpGlue(const T1& in_A, const T2& in_B)
16 | : A(in_A)
17 | , B(in_B)
18 | {
19 | arma_extra_debug_sigprint();
20 | }
21 |
22 |
23 |
24 | template
25 | inline
26 | SpGlue::SpGlue(const T1& in_A, const T2& in_B, const typename T1::elem_type in_aux)
27 | : A(in_A)
28 | , B(in_B)
29 | , aux(in_aux)
30 | {
31 | arma_extra_debug_sigprint();
32 | }
33 |
34 |
35 |
36 | template
37 | inline
38 | SpGlue::~SpGlue()
39 | {
40 | arma_extra_debug_sigprint();
41 | }
42 |
43 |
44 |
45 | //! @}
46 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/SpOp_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2012 Conrad Sanderson
2 | //
3 | // This Source Code Form is subject to the terms of the Mozilla Public
4 | // License, v. 2.0. If a copy of the MPL was not distributed with this
5 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 |
7 |
8 | //! \addtogroup SpOp
9 | //! @{
10 |
11 |
12 |
13 | template
14 | class SpOp : public SpBase >
15 | {
16 | public:
17 |
18 | typedef typename T1::elem_type elem_type;
19 | typedef typename get_pod_type::result pod_type;
20 |
21 | static const bool is_row = (T1::is_row && is_spop_elem::value) || ( T1::is_col && (is_same_type::value || is_same_type::value) );
22 | static const bool is_col = (T1::is_col && is_spop_elem::value) || ( T1::is_row && (is_same_type::value || is_same_type::value) );
23 |
24 | inline explicit SpOp(const T1& in_m);
25 | inline SpOp(const T1& in_m, const elem_type in_aux);
26 | inline SpOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b);
27 | inline ~SpOp();
28 |
29 |
30 | arma_aligned const T1& m; //!< storage of reference to the operand (eg. a matrix)
31 | arma_aligned elem_type aux; //!< storage of auxiliary data, user defined format
32 | arma_aligned uword aux_uword_a; //!< storage of auxiliary data, uword format
33 | arma_aligned uword aux_uword_b; //!< storage of auxiliary data, uword format
34 | };
35 |
36 |
37 |
38 | //! @}
39 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/SpOp_meat.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2012 Conrad Sanderson
2 | //
3 | // This Source Code Form is subject to the terms of the Mozilla Public
4 | // License, v. 2.0. If a copy of the MPL was not distributed with this
5 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 |
7 |
8 | //! \addtogroup SpOp
9 | //! @{
10 |
11 |
12 |
13 | template
14 | inline
15 | SpOp::SpOp(const T1& in_m)
16 | : m(in_m)
17 | {
18 | arma_extra_debug_sigprint();
19 | }
20 |
21 |
22 |
23 | template
24 | inline
25 | SpOp::SpOp(const T1& in_m, const typename T1::elem_type in_aux)
26 | : m(in_m)
27 | , aux(in_aux)
28 | {
29 | arma_extra_debug_sigprint();
30 | }
31 |
32 |
33 |
34 | template
35 | inline
36 | SpOp::SpOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b)
37 | : m(in_m)
38 | , aux_uword_a(in_aux_uword_a)
39 | , aux_uword_b(in_aux_uword_b)
40 | {
41 | arma_extra_debug_sigprint();
42 | }
43 |
44 |
45 |
46 | template
47 | inline
48 | SpOp::~SpOp()
49 | {
50 | arma_extra_debug_sigprint();
51 | }
52 |
53 |
54 |
55 | //! @}
56 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/access.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2013 Conrad Sanderson
2 | // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup access
10 | //! @{
11 |
12 |
13 | class access
14 | {
15 | public:
16 |
17 | //! internal function to allow modification of data declared as read-only (use with caution)
18 | template arma_inline static T1& rw (const T1& x) { return const_cast(x); }
19 | template arma_inline static T1*& rwp(const T1* const& x) { return const_cast(x); }
20 |
21 | //! internal function to obtain the real part of either a plain number or a complex number
22 | template arma_inline static const eT& tmp_real(const eT& X) { return X; }
23 | template arma_inline static const T tmp_real(const std::complex& X) { return X.real(); }
24 |
25 | //! internal function to work around braindead compilers
26 | template arma_inline static const typename enable_if2::value, const eT&>::result alt_conj(const eT& X) { return X; }
27 | template arma_inline static const typename enable_if2< is_complex::value, const eT >::result alt_conj(const eT& X) { return std::conj(X); }
28 | };
29 |
30 |
31 | //! @}
32 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/arma_static_check.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2011 Conrad Sanderson
2 | // Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup arma_static_check
10 | //! @{
11 |
12 |
13 |
14 | template
15 | struct arma_type_check_cxx1998
16 | {
17 | arma_inline
18 | static
19 | void
20 | apply()
21 | {
22 | static const char
23 | junk[ ERROR___INCORRECT_OR_UNSUPPORTED_TYPE ? -1 : +1 ];
24 | }
25 | };
26 |
27 |
28 |
29 | template<>
30 | struct arma_type_check_cxx1998
31 | {
32 | arma_inline
33 | static
34 | void
35 | apply()
36 | {
37 | }
38 | };
39 |
40 |
41 |
42 | #if defined(ARMA_USE_CXX11)
43 |
44 | #define arma_static_check(condition, message) static_assert( !(condition), #message )
45 |
46 | #define arma_type_check(condition) static_assert( !(condition), "error: incorrect or unsupported type" )
47 |
48 | #else
49 |
50 | #define arma_static_check(condition, message) static const char message[ (condition) ? -1 : +1 ]
51 |
52 | #define arma_type_check(condition) arma_type_check_cxx1998::apply()
53 |
54 | #endif
55 |
56 |
57 |
58 | //! @}
59 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/arma_version.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2009-2014 Conrad Sanderson
2 | // Copyright (C) 2009-2014 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup arma_version
10 | //! @{
11 |
12 |
13 |
14 | #define ARMA_VERSION_MAJOR 4
15 | #define ARMA_VERSION_MINOR 200
16 | #define ARMA_VERSION_PATCH 0
17 | #define ARMA_VERSION_NAME "Flintlock Swoop"
18 |
19 |
20 |
21 | struct arma_version
22 | {
23 | static const unsigned int major = ARMA_VERSION_MAJOR;
24 | static const unsigned int minor = ARMA_VERSION_MINOR;
25 | static const unsigned int patch = ARMA_VERSION_PATCH;
26 |
27 | static
28 | inline
29 | std::string
30 | as_string()
31 | {
32 | const char* nickname = ARMA_VERSION_NAME;
33 |
34 | std::stringstream ss;
35 | ss << arma_version::major
36 | << '.'
37 | << arma_version::minor
38 | << '.'
39 | << arma_version::patch
40 | << " ("
41 | << nickname
42 | << ')';
43 |
44 | return ss.str();
45 | }
46 | };
47 |
48 |
49 |
50 | //! @}
51 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/compiler_setup_post.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Conrad Sanderson
2 | // Copyright (C) 2013 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 |
10 | #if defined(_MSC_VER)
11 |
12 | #pragma warning(pop)
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/cond_rel_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2012 NICTA (www.nicta.com.au)
2 | // Copyright (C) 2012 Conrad Sanderson
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup cond_rel
10 | //! @{
11 |
12 |
13 | //
14 | // for preventing pedantic compiler warnings
15 |
16 | template
17 | class cond_rel
18 | {
19 | public:
20 |
21 | template arma_inline static bool lt(const eT A, const eT B);
22 | template arma_inline static bool gt(const eT A, const eT B);
23 |
24 | template arma_inline static bool leq(const eT A, const eT B);
25 | template arma_inline static bool geq(const eT A, const eT B);
26 | };
27 |
28 |
29 |
30 | //! @}
31 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/cond_rel_meat.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2012 NICTA (www.nicta.com.au)
2 | // Copyright (C) 2012 Conrad Sanderson
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup cond_rel
10 | //! @{
11 |
12 |
13 |
14 | template<>
15 | template
16 | arma_inline
17 | bool
18 | cond_rel::lt(const eT A, const eT B)
19 | {
20 | return (A < B);
21 | }
22 |
23 |
24 |
25 | template<>
26 | template
27 | arma_inline
28 | bool
29 | cond_rel::lt(const eT, const eT)
30 | {
31 | return false;
32 | }
33 |
34 |
35 |
36 | template<>
37 | template
38 | arma_inline
39 | bool
40 | cond_rel::gt(const eT A, const eT B)
41 | {
42 | return (A > B);
43 | }
44 |
45 |
46 |
47 | template<>
48 | template
49 | arma_inline
50 | bool
51 | cond_rel::gt(const eT, const eT)
52 | {
53 | return false;
54 | }
55 |
56 |
57 |
58 | template<>
59 | template
60 | arma_inline
61 | bool
62 | cond_rel::leq(const eT A, const eT B)
63 | {
64 | return (A <= B);
65 | }
66 |
67 |
68 |
69 | template<>
70 | template
71 | arma_inline
72 | bool
73 | cond_rel::leq(const eT, const eT)
74 | {
75 | return false;
76 | }
77 |
78 |
79 |
80 | template<>
81 | template
82 | arma_inline
83 | bool
84 | cond_rel::geq(const eT A, const eT B)
85 | {
86 | return (A >= B);
87 | }
88 |
89 |
90 |
91 | template<>
92 | template
93 | arma_inline
94 | bool
95 | cond_rel::geq(const eT, const eT)
96 | {
97 | return false;
98 | }
99 |
100 |
101 |
102 | //! @}
103 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/distr_param.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Conrad Sanderson
2 | // Copyright (C) 2013 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 |
10 | //! \addtogroup distr_param
11 | //! @{
12 |
13 |
14 |
15 | class distr_param
16 | {
17 | public:
18 |
19 | uword state;
20 |
21 | union
22 | {
23 | int a_int;
24 | double a_double;
25 | };
26 |
27 | union
28 | {
29 | int b_int;
30 | double b_double;
31 | };
32 |
33 |
34 | inline distr_param()
35 | : state(0)
36 | {
37 | }
38 |
39 |
40 | inline explicit distr_param(const int a, const int b)
41 | : state(1)
42 | , a_int(a)
43 | , b_int(b)
44 | {
45 | }
46 |
47 |
48 | inline explicit distr_param(const double a, const double b)
49 | : state(2)
50 | , a_double(a)
51 | , b_double(b)
52 | {
53 | }
54 | };
55 |
56 |
57 |
58 | //! @}
59 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/eGlueCube_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2010-2013 Conrad Sanderson
2 | // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup eGlueCube
10 | //! @{
11 |
12 |
13 | template
14 | class eGlueCube : public BaseCube >
15 | {
16 | public:
17 |
18 | typedef typename T1::elem_type elem_type;
19 | typedef typename get_pod_type::result pod_type;
20 |
21 | static const bool prefer_at_accessor = (ProxyCube::prefer_at_accessor || ProxyCube::prefer_at_accessor);
22 | static const bool has_subview = (ProxyCube::has_subview || ProxyCube::has_subview );
23 |
24 | arma_aligned const ProxyCube P1;
25 | arma_aligned const ProxyCube P2;
26 |
27 | arma_inline ~eGlueCube();
28 | arma_inline eGlueCube(const T1& in_A, const T2& in_B);
29 |
30 | arma_inline uword get_n_rows() const;
31 | arma_inline uword get_n_cols() const;
32 | arma_inline uword get_n_elem_slice() const;
33 | arma_inline uword get_n_slices() const;
34 | arma_inline uword get_n_elem() const;
35 |
36 | arma_inline elem_type operator[] (const uword i) const;
37 | arma_inline elem_type at (const uword row, const uword col, const uword slice) const;
38 | arma_inline elem_type at_alt (const uword i) const;
39 | };
40 |
41 |
42 |
43 | //! @}
44 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/eGlue_bones.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2010-2013 Conrad Sanderson
2 | // Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup eGlue
10 | //! @{
11 |
12 |
13 | template
14 | class eGlue : public Base >
15 | {
16 | public:
17 |
18 | typedef typename T1::elem_type elem_type;
19 | typedef typename get_pod_type::result pod_type;
20 | typedef Proxy proxy1_type;
21 | typedef Proxy proxy2_type;
22 |
23 | static const bool prefer_at_accessor = (Proxy::prefer_at_accessor || Proxy::prefer_at_accessor);
24 | static const bool has_subview = (Proxy::has_subview || Proxy::has_subview );
25 | static const bool is_fixed = (Proxy::is_fixed || Proxy::is_fixed );
26 | static const bool fake_mat = (Proxy::fake_mat || Proxy::fake_mat );
27 |
28 | static const bool is_col = (Proxy::is_col || Proxy::is_col);
29 | static const bool is_row = (Proxy::is_row || Proxy::is_row);
30 |
31 | arma_aligned const Proxy P1;
32 | arma_aligned const Proxy P2;
33 |
34 | arma_inline ~eGlue();
35 | arma_inline eGlue(const T1& in_A, const T2& in_B);
36 |
37 | arma_inline uword get_n_rows() const;
38 | arma_inline uword get_n_cols() const;
39 | arma_inline uword get_n_elem() const;
40 |
41 | arma_inline elem_type operator[] (const uword ii) const;
42 | arma_inline elem_type at (const uword row, const uword col) const;
43 | arma_inline elem_type at_alt (const uword ii) const;
44 | };
45 |
46 |
47 |
48 | //! @}
49 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_chol.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2009-2011 Conrad Sanderson
2 | // Copyright (C) 2009-2011 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup fn_chol
10 | //! @{
11 |
12 |
13 |
14 | template
15 | inline
16 | const Op
17 | chol
18 | (
19 | const Base& X,
20 | const typename arma_blas_type_only::result* junk = 0
21 | )
22 | {
23 | arma_extra_debug_sigprint();
24 | arma_ignore(junk);
25 |
26 | return Op(X.get_ref());
27 | }
28 |
29 |
30 |
31 | template
32 | inline
33 | bool
34 | chol
35 | (
36 | Mat& out,
37 | const Base& X,
38 | const typename arma_blas_type_only::result* junk = 0
39 | )
40 | {
41 | arma_extra_debug_sigprint();
42 | arma_ignore(junk);
43 |
44 | try
45 | {
46 | out = chol(X);
47 | }
48 | catch(std::runtime_error&)
49 | {
50 | return false;
51 | }
52 |
53 | return true;
54 | }
55 |
56 |
57 |
58 | //! @}
59 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_cond.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2013 Conrad Sanderson
2 | // Copyright (C) 2013 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup fn_cond
10 | //! @{
11 |
12 |
13 | template
14 | arma_warn_unused
15 | inline
16 | typename enable_if2::value, typename T1::pod_type>::result
17 | cond(const Base& X)
18 | {
19 | arma_extra_debug_sigprint();
20 |
21 | typedef typename T1::pod_type T;
22 |
23 | Col S;
24 |
25 | const bool status = auxlib::svd_dc(S, X);
26 |
27 | if(status == false)
28 | {
29 | arma_bad("cond(): failed to converge", false);
30 |
31 | return T(0);
32 | }
33 |
34 | if(S.n_elem > 0)
35 | {
36 | return T( max(S) / min(S) );
37 | }
38 | else
39 | {
40 | return T(0);
41 | }
42 | }
43 |
44 |
45 |
46 |
47 | //! @}
48 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_conv.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2010 Conrad Sanderson
2 | // Copyright (C) 2010 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup fn_conv
10 | //! @{
11 |
12 |
13 |
14 | //! Convolution, which is also equivalent to polynomial multiplication and FIR digital filtering.
15 |
16 | template
17 | inline
18 | const Glue
19 | conv(const Base& A, const Base& B)
20 | {
21 | arma_extra_debug_sigprint();
22 |
23 | return Glue(A.get_ref(), B.get_ref());
24 | }
25 |
26 |
27 |
28 | //! @}
29 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_cor.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2009-2010 Conrad Sanderson
2 | // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
3 | // Copyright (C) 2009-2010 Dimitrios Bouzas
4 | //
5 | // This Source Code Form is subject to the terms of the Mozilla Public
6 | // License, v. 2.0. If a copy of the MPL was not distributed with this
7 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 |
9 |
10 | //! \addtogroup fn_cor
11 | //! @{
12 |
13 |
14 |
15 | template
16 | inline
17 | const Op
18 | cor(const Base& X, const uword norm_type = 0)
19 | {
20 | arma_extra_debug_sigprint();
21 |
22 | arma_debug_check( (norm_type > 1), "cor(): norm_type must be 0 or 1");
23 |
24 | return Op(X.get_ref(), norm_type, 0);
25 | }
26 |
27 |
28 |
29 | template
30 | inline
31 | const Glue
32 | cor(const Base& A, const Base& B, const uword norm_type = 0)
33 | {
34 | arma_extra_debug_sigprint();
35 |
36 | arma_debug_check( (norm_type > 1), "cor(): norm_type must be 0 or 1");
37 |
38 | return Glue(A.get_ref(), B.get_ref(), norm_type);
39 | }
40 |
41 |
42 |
43 | //! @}
44 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_cov.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2009-2010 Conrad Sanderson
2 | // Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
3 | // Copyright (C) 2009-2010 Dimitrios Bouzas
4 | //
5 | // This Source Code Form is subject to the terms of the Mozilla Public
6 | // License, v. 2.0. If a copy of the MPL was not distributed with this
7 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 |
9 |
10 | //! \addtogroup fn_cov
11 | //! @{
12 |
13 |
14 |
15 | template
16 | inline
17 | const Op
18 | cov(const Base& X, const uword norm_type = 0)
19 | {
20 | arma_extra_debug_sigprint();
21 |
22 | arma_debug_check( (norm_type > 1), "cov(): norm_type must be 0 or 1");
23 |
24 | return Op(X.get_ref(), norm_type, 0);
25 | }
26 |
27 |
28 |
29 | template
30 | inline
31 | const Glue
32 | cov(const Base& A, const Base& B, const uword norm_type = 0)
33 | {
34 | arma_extra_debug_sigprint();
35 |
36 | arma_debug_check( (norm_type > 1), "cov(): norm_type must be 0 or 1");
37 |
38 | return Glue(A.get_ref(), B.get_ref(), norm_type);
39 | }
40 |
41 |
42 |
43 | //! @}
44 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_cross.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2010 Conrad Sanderson
2 | // Copyright (C) 2010 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup fn_cross
10 | //! @{
11 |
12 |
13 |
14 | //! cross product (only valid for 3 dimensional vectors)
15 | template
16 | inline
17 | const Glue
18 | cross(const Base& X, const Base& Y)
19 | {
20 | arma_extra_debug_sigprint();
21 |
22 | return Glue(X.get_ref(), Y.get_ref());
23 | }
24 |
25 |
26 |
27 | //! @}
28 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_diagmat.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2012 Conrad Sanderson
2 | // Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup fn_diagmat
10 | //! @{
11 |
12 |
13 | //! interpret a matrix or a vector as a diagonal matrix (i.e. off-diagonal entries are zero)
14 | template
15 | arma_inline
16 | typename
17 | enable_if2
18 | <
19 | is_arma_type::value,
20 | const Op
21 | >::result
22 | diagmat(const T1& X)
23 | {
24 | arma_extra_debug_sigprint();
25 |
26 | return Op(X);
27 | }
28 |
29 |
30 |
31 | // TODO:
32 | // create "op_diagmat2", to allow placement of vector onto a sub- or super- diagonal.
33 | // op_diagmat2 is required, as other code assumes that op_diagmat indicates only the main diagonal)
34 |
35 |
36 |
37 | //! @}
38 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_diagvec.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2010 Conrad Sanderson
2 | // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup fn_diagvec
10 | //! @{
11 |
12 |
13 | //! extract a diagonal from a matrix
14 | template
15 | arma_inline
16 | const Op
17 | diagvec(const Base& X, const sword diag_id = 0)
18 | {
19 | arma_extra_debug_sigprint();
20 |
21 | return Op(X.get_ref(), ((diag_id < 0) ? -diag_id : diag_id), ((diag_id < 0) ? 1 : 0) );
22 | }
23 |
24 |
25 |
26 | //! @}
27 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_eye.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2008-2012 Conrad Sanderson
2 | // Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup fn_eye
10 | //! @{
11 |
12 |
13 |
14 | arma_inline
15 | const Gen
16 | eye(const uword n_rows, const uword n_cols)
17 | {
18 | arma_extra_debug_sigprint();
19 |
20 | return Gen(n_rows, n_cols);
21 | }
22 |
23 |
24 |
25 | template
26 | arma_inline
27 | const Gen
28 | eye(const uword n_rows, const uword n_cols, const typename arma_Mat_Col_Row_only::result* junk = 0)
29 | {
30 | arma_extra_debug_sigprint();
31 | arma_ignore(junk);
32 |
33 | if(is_Col::value == true)
34 | {
35 | arma_debug_check( (n_cols != 1), "eye(): incompatible size" );
36 | }
37 | else
38 | if(is_Row::value == true)
39 | {
40 | arma_debug_check( (n_rows != 1), "eye(): incompatible size" );
41 | }
42 |
43 | return Gen(n_rows, n_cols);
44 | }
45 |
46 |
47 |
48 | //! @}
49 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_flip.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2010 Conrad Sanderson
2 | // Copyright (C) 2010 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 | //! \addtogroup fn_flip
10 | //! @{
11 |
12 |
13 |
14 | template
15 | arma_inline
16 | const Op
17 | flipud(const Base& X)
18 | {
19 | arma_extra_debug_sigprint();
20 |
21 | return Op(X.get_ref());
22 | }
23 |
24 |
25 |
26 | template
27 | arma_inline
28 | const Op
29 | fliplr(const Base& X)
30 | {
31 | arma_extra_debug_sigprint();
32 |
33 | return Op(X.get_ref());
34 | }
35 |
36 |
37 |
38 | //! @}
39 |
--------------------------------------------------------------------------------
/include/armadillo/armadillo_bits/fn_hist.hpp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2012 Conrad Sanderson
2 | // Copyright (C) 2012 NICTA (www.nicta.com.au)
3 | //
4 | // This Source Code Form is subject to the terms of the Mozilla Public
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 |
8 |
9 |
10 | template
11 | inline
12 | const mtOp
13 | hist
14 | (
15 | const Base