MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
PPRep.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGPPRep_HH_
6 #define _MGPPRep_HH_
7 
12 #include "mg/NDDArray.h"
13 #include "mg/Vector.h"
14 
15 // MGPPRep.h
16 //
17 
18 // Forward Declaration
19 class MGLBRep;
20 class MGIfstream;
21 class MGOfstream;
22 
24 
32 class MG_DLL_DECLR MGPPRep {
33 
34 public:
35 
37 MG_DLL_DECLR friend std::ostream& operator<< (std::ostream&, const MGPPRep& );
38 
40 
42 MGPPRep();
43 
45 MGPPRep(int order, int nbreak, int sdim);
46 
48 MGPPRep(int order, int sdim, const MGNDDArray& tau);
49 
51 MGPPRep(const MGLBRep& lbrep);
52 
57 MGPPRep(int order, const MGPPRep& pprep);
58 
60 MGPPRep(const MGPPRep& rhs);
61 
63 
64 ~MGPPRep(){if(m_coef) delete[] m_coef;};
65 
67 
68 MGPPRep& operator=(const MGPPRep&);
69 
71 double operator()(int i,int j, int k) const{return coef(i,j,k);}
72 double& operator()(int i,int j, int k){return coef(i,j,k);}
73 
75 MGVector operator()(int i, int j)const{return coef(i,j);};
76 
78 
80 const MGNDDArray& break_point()const{return m_break_point;}
81 
83 double break_point(int i)const{return m_break_point(i);}
84 
86 double& break_point(int i){return m_break_point(i);}
87 
89 const double* break_point_data()const{return m_break_point.data();}
90 
92 double coef(int i, int j, int k)const;
93 
95 double& coef(int i, int j, int k);
96 
98 MGVector coef(int i, int j)const;
99 
101 const double* coef_data(int i=0, int j=0, int k=0)const;
102 
104 MGVector eval(
105  double t,
106  int n=0
107 )const;
108 
110 MGVector eval_i(
111  int i,
112  double t,
113  int n
114 )const;
115 
117 int nbreak()const{return m_nbreak;}
118 
122 MGPPRep& normalize();
123 
125 int order()const{return m_order;}
126 
128 double ref(int i, int j, int k)const;
129 
132 void reshape(int nbreak);
133 
136 void resize(
137  int order,
138  int nbreak,
139  int dim
140 );
141 
143 int sdim()const{return m_sdim;}
144 
146 void store_at(int i, int j, const MGVector& v);
147 
149 int dump_size()const;
150 
152 int dump(MGOfstream& )const;
153 
155 int restore(MGIfstream& );
156 
158 
159 private:
160 
161  int m_order;
162  int m_nbreak;
163  int m_sdim;
165  MGNDDArray m_break_point;
166  double* m_coef;
167 
168 };
169  // end of GEORelated group
171 #endif
const double * break_point_data() const
Returns a pointer to the break_point data.
Definition: PPRep.h:89
Defines PP-Represetation of a spline.
Definition: PPRep.h:32
double operator()(int i, int j, int k) const
Assignment.
Definition: PPRep.h:71
int order() const
Returns the order of PPRep.
Definition: PPRep.h:125
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
MGVector operator()(int i, int j) const
Extract (i,j,k)elements for 0<=k
Definition: PPRep.h:75
std::ostream & operator<<(std::ostream &ostrm, const MGisect &is)
Debug Function.
Definition: isect.h:95
int nbreak() const
Returns the number of Break points including the end point.
Definition: PPRep.h:117
MGLBRep is a class for B-SPline representation.
Definition: LBRep.h:41
Vector of a general n space dimension.
Definition: Vector.h:26
int sdim() const
Returns the space dimension.
Definition: PPRep.h:143
double & break_point(int i)
Returns a pointer to i-th break_point to access.
Definition: PPRep.h:86
const MGNDDArray & break_point() const
Returns break point sequence.
Definition: PPRep.h:80
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
Defines non-decreasing double data array.
Definition: NDDArray.h:27
double break_point(int i) const
Returns i-th break point value.
Definition: PPRep.h:83
double & operator()(int i, int j, int k)
Definition: PPRep.h:72
~MGPPRep()
Definition: PPRep.h:64