5 #ifndef _MGNDDArray_HH_
6 #define _MGNDDArray_HH_
40 MGNDDArray():m_capacity(0),m_length(0),m_current(0),m_element(0){;};
50 MGNDDArray(
int n,
double init,
double increment=1.0);
116 double operator[] (
int i)
const{
return m_element[i];};
117 double operator() (
int i)
const{
return m_element[i];};
120 double& operator[] (
int i){
return m_element[i];};
121 double& operator() (
int i){
return m_element[i];};
144 bool operator!= (
const MGNDDArray& t2)
const{
return !operator==(t2);}
151 int add_data(
double value,
int mult_max=1);
155 int add_data(
const MGKnot& knot,
int mult_max);
158 void copy_removing_multi(
165 const double*
data(
int i=0)
const{
return &m_element[i]; };
168 double*
data(
int i=0) {
return &m_element[i]; };
173 int del_data(
int index);
182 void set_length(
int length);
185 virtual void set_null();
191 void store_with_capacityCheck(
202 virtual int locate(
double tau)
const;
213 virtual int locate_multi(
int start,
int multi,
int& index)
const;
217 virtual void change_range(
double ts,
double te);
227 double ref(
int i)
const{
return m_element[i];};
230 void remove_too_near(
231 bool allow_multi=
false,
241 void remove_too_near(
243 bool allow_multi=
false,
258 void reshape(
int size,
int start=0);
262 void resize(
int nsize);
272 virtual int dump_size()
const;
int capacity() const
Return the size of MGNDDArray.
Definition: NDDArray.h:265
double * data(int i=0)
Return a pointer to raw data of MGNDDArray.
Definition: NDDArray.h:168
int length() const
Return the length of MGNDDArray.
Definition: NDDArray.h:179
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
std::ostream & operator<<(std::ostream &ostrm, const MGisect &is)
Debug Function.
Definition: isect.h:95
MG_DLL_DECLR MGVector & operator*=(MGVector &v, const MGMatrix &m)
MG_DLL_DECLR MGVector operator*(const MGVector &v, const MGMatrix &m)
MGNDDArray()
void constructor.
Definition: NDDArray.h:40
Defines Knot vector of B-Representation.
Definition: KnotVector.h:28
bool is_null() const
Test if this is null.
Definition: NDDArray.h:176
double ref(int i) const
Reference to i-th element.
Definition: NDDArray.h:227
Defines BPoint seq of a space dimension and of a capacity.
Definition: BPointSeq.h:38
int m_current
current interval of the array is held.
Definition: NDDArray.h:282
const double * data(int i=0) const
Return a pointer to raw data of MGNDDArray.
Definition: NDDArray.h:165
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
virtual ~MGNDDArray()
Definition: NDDArray.h:111
MGENDCOND
End condition to get spline by interpolation.
Definition: MGCL.h:219
Defines non-decreasing double data array.
Definition: NDDArray.h:27
Defines knot value and its multiplicity.
Definition: Knot.h:20