26#include "vtkObjectFactory.h"
44 if (this->
Array != NULL)
46 delete [] this->
Array;
58 if ( this->
Array != NULL )
60 delete [] this->
Array;
75 this->
Array[i] = value;
91 vtkErrorMacro(<<
"Vectors have different number of elements.");
101 memcpy(this->
Array, array, numberOfElements *
sizeof(
double));
115 value = this->
Array[i];
116 norm += value * value;
118 norm = std::sqrt(norm);
125 value = this->
Array[i];
140 vtkErrorMacro(<<
"Vector to add does not have the same number of elements.");
154 vtkErrorMacro(<<
"Vector to add does not have the same number of elements.");
168 this->
Array[i] *= scalar;
178 vtkErrorMacro(<<
"Vector to add does not have the same number of elements.");
185 dot += this->
Array[i] * vectorToDotWith->
Array[i];
197 vtkErrorMacro(<<
"NULL vtkDoubleArray provided!");
201 if (component > array->GetNumberOfComponents()-1)
203 array->SetNumberOfComponents(component+1);
213 array->SetComponent(i,component,this->
Array[i]);
223 vtkErrorMacro(<<
"NULL vtkDoubleArray provided!");
227 if (component > array->GetNumberOfComponents()-1)
229 array->SetNumberOfComponents(component+1);
239 array->SetComponent(i,component,this->
Array[i+variable*this->NumberOfElementsPerVariable]);
248 if (this->
Array != NULL)
250 delete [] this->
Array;
Serves as the base class for vectors utilized in finite-element and other PDE evaluations.
double Dot(vtkvmtkDoubleVector *vectorToDotWith)
void Subtract(vtkvmtkDoubleVector *vectorToSubtract)
void CopyVariableIntoArrayComponent(vtkDataArray *array, int variable, int component)
vtkIdType NumberOfElements
void DeepCopy(vtkvmtkDoubleVector *src)
void CopyIntoArrayComponent(vtkDataArray *array, int component)
vtkIdType NumberOfElementsPerVariable
void Add(vtkvmtkDoubleVector *vectorToAdd)
double GetElement(vtkIdType i)
void Assign(vtkvmtkDoubleVector *src)
void Allocate(vtkIdType numberOfElementsPerVariable, vtkIdType numberOfVariables=1)
void MultiplyBy(double scalar)
vtkIdType NumberOfVariables
#define VTK_VMTK_LARGE_DOUBLE
vtkStandardNewMacro(vtkvmtkDoubleVector)
#define VTK_VMTK_LINF_NORM