You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.4 KiB
61 lines
1.4 KiB
15 years ago
|
//
|
||
|
// $filename
|
||
|
// $projectname
|
||
|
//
|
||
|
// Created by Joshua moerman on $TODAY.
|
||
|
// Copyright 2010 Joshua Moerman. All rights reserved.
|
||
|
//
|
||
|
|
||
|
const static unsigned int dimension = 3;
|
||
|
const static unsigned int numberOfParameters = 3;
|
||
|
|
||
|
PolynomialA3D::PolynomialA3D(){
|
||
|
init();
|
||
|
}
|
||
|
|
||
|
void PolynomialA3D::init(){
|
||
|
myParameters = new double[numberOfParameters];
|
||
|
vectorNew = new double[dimension];
|
||
|
vectorOld = new double[dimension];
|
||
|
|
||
|
assert(myParameters != NULL);
|
||
|
assert(vectorNew != NULL);
|
||
|
assert(vectorOld != NULL);
|
||
|
for ( unsigned int i = 0; i < numberOfParameters; i++ ) {
|
||
|
myParameters[i] = 0.0;
|
||
|
}
|
||
|
for ( unsigned int i = 0; i < dimension; i++ ) {
|
||
|
vectorNew[i] = vectorOld[i] = 0.0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// setters, getters, all i/o to other classes/objects
|
||
|
void * PolynomialA3D::getProperty(const string identifier) {
|
||
|
if ( identifier == "dimension" ) {
|
||
|
unsigned int * _return = new unsigned int;
|
||
|
*_return = dimension;
|
||
|
return _return;
|
||
|
}
|
||
|
return NULL;
|
||
|
}
|
||
|
|
||
|
void PolynomialA3D::setProperty(const string identifier, const void * _value) {
|
||
|
|
||
|
}
|
||
|
|
||
|
double * & PolynomialA3D::parameters() {
|
||
|
return myParameters;
|
||
|
}
|
||
|
|
||
|
double & PolynomialA3D::parameter(const unsigned int index) {
|
||
|
return myParameters[index];
|
||
|
}
|
||
|
|
||
|
double * & PolynomialA3D::vector() {
|
||
|
return vectorNew;
|
||
|
}
|
||
|
|
||
|
double * & PolynomialA3D::previousVector() {
|
||
|
return vectorOld;
|
||
|
}
|