Subversion Repositories gelsvn

Rev

Rev 663 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 663 Rev 664
1
/*
1
/*
2
 *  harmonics.h
2
 *  harmonics.h
3
 *  GEL
3
 *  GEL
4
 *
4
 *
5
 *  Created by J. Andreas Bærentzen on 01/09/08.
5
 *  Created by J. Andreas Bærentzen on 01/09/08.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
7
 *
7
 *
8
 */
8
 */
9
 
9
 
10
#ifndef __MESHEDIT_HARMONICS_H__
10
#ifndef __MESHEDIT_HARMONICS_H__
11
#define __MESHEDIT_HARMONICS_H__
11
#define __MESHEDIT_HARMONICS_H__
12
 
12
 
13
#include "../CGLA/Vec3d.h"
13
#include "../CGLA/Vec3d.h"
14
#include "../HMesh/Manifold.h"
14
#include "../HMesh/Manifold.h"
15
#include "../HMesh/AttributeVector.h"
15
#include "../HMesh/AttributeVector.h"
16
#include "../LinAlg/Matrix.h"
16
#include "../LinAlg/Matrix.h"
17
#include "../LinAlg/Vector.h"
17
#include "../LinAlg/Vector.h"
18
 
18
 
19
namespace  HMesh {
19
namespace  HMesh {
20
    
20
    
21
    class Harmonics
21
    class Harmonics
22
    {
22
    {
23
        HMesh::Manifold& mani;
23
        HMesh::Manifold& mani;
24
        HMesh::VertexAttributeVector<int> vtouched;
24
        HMesh::VertexAttributeVector<int> vtouched;
25
        
25
        
26
        int maximum_eigenvalue;
26
        int maximum_eigenvalue;
27
        
27
        
28
        bool is_initialized;
28
        bool is_initialized;
29
        
29
        
30
        std::vector<CGLA::Vec3d> proj;
30
        std::vector<CGLA::Vec3d> proj;
31
        
31
        
32
        LinAlg::CMatrix Q;
32
        LinAlg::CMatrix Q;
33
        LinAlg::CVector qnorm;
33
        LinAlg::CVector qnorm;
34
        LinAlg::CVector V;
34
        LinAlg::CVector V;
35
        LinAlg::CVector S;
35
        LinAlg::CVector S;
36
        
36
        
37
        std::vector<float> max_eig_values;
37
        std::vector<float> max_eig_values;
38
        
38
        
39
        void make_laplace_operator();
39
        void make_laplace_operator();
40
        void make_laplace_operator_sparse();
40
        void make_laplace_operator_sparse();
41
        
41
        
42
    public:
42
    public:
43
        
43
        
-
 
44
        std::vector<CGLA::Vec3d> analyze_signal(const HMesh::VertexAttributeVector<CGLA::Vec3d>& sig);
-
 
45
        
-
 
46
        HMesh::VertexAttributeVector<CGLA::Vec3d> reconstruct_signal(const std::vector<CGLA::Vec3d>& sig_proj, int);
-
 
47
        
44
        /// Initial analysis of harmonics
48
        /// Initial analysis of harmonics
45
        Harmonics(HMesh::Manifold& mani);
49
        Harmonics(HMesh::Manifold& mani);
46
        
50
        
47
        /// Add a frequency to mesh reconstruction
51
        /// Add a frequency to mesh reconstruction
48
        void add_frequency(int f, float scale = 1.0f);
52
        void add_frequency(int f, float scale = 1.0f);
49
        
53
        
50
        /// Reset the shape to use 0 eigenvalues
54
        /// Reset the shape to use 0 eigenvalues
51
        void reset_shape();
55
        void reset_shape();
52
        
56
        
53
        /// Do a partial reconstruct with an interval of eigenvalues
57
        /// Do a partial reconstruct with an interval of eigenvalues
54
        void partial_reconstruct(int E0, int E1, float scale=1.0f);
58
        void partial_reconstruct(int E0, int E1, float scale=1.0f);
55
        
59
        
56
        double compute_adf(HMesh::VertexAttributeVector<double>& adf, double t, double fiedler_boost=0);
60
        double compute_adf(HMesh::VertexAttributeVector<double>& adf, double t, double fiedler_boost=0);
57
 
61
 
58
        double compute_esum(HMesh::VertexAttributeVector<double>& adf, int e0, int e1);
62
        double compute_esum(HMesh::VertexAttributeVector<double>& adf, int e0, int e1);
59
        
63
        
60
    };
64
    };
61
    
65
    
62
}
66
}
63
#endif
67
#endif
64
 
68
 
65
 
69