Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
- val(nullptr)
+ values(nullptr)
{
if (vec_size != 0)
{
Subscriptor(std::move(v)),
vec_size(v.vec_size),
max_vec_size(v.max_vec_size),
- val(v.val),
+ values(v.values),
thread_loop_partitioner(std::move(v.thread_loop_partitioner))
{
v.vec_size = 0;
v.max_vec_size = 0;
- v.val = nullptr;
+ v.values = nullptr;
}
Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
- val(nullptr)
+ values(nullptr)
{
if (vec_size != 0)
{
Subscriptor(),
vec_size(0),
max_vec_size(0),
- val(nullptr)
+ values(nullptr)
{
if (v.size() != 0)
{
Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
- val(nullptr)
+ values(nullptr)
{
if (vec_size != 0)
{
if (vec_size>0)
{
- dealii::internal::VectorOperations::Vector_copy<Number,Number> copier(v.val, val);
+ dealii::internal::VectorOperations::Vector_copy<Number,Number> copier(v.values, values);
internal::VectorOperations::parallel_for(copier,0,vec_size,thread_loop_partitioner);
}
{
Subscriptor::operator=(std::move(v));
- if (val) deallocate();
+ if (values) deallocate();
vec_size = v.vec_size;
max_vec_size = v.max_vec_size;
- val = v.val;
+ values = v.values;
thread_loop_partitioner = std::move(v.thread_loop_partitioner);
v.vec_size = 0;
v.max_vec_size = 0;
- v.val = nullptr;
+ v.values = nullptr;
return *this;
}
if (vec_size != v.vec_size)
reinit (v, true);
- dealii::internal::VectorOperations::Vector_copy<Number,Number2> copier(v.val, val);
+ dealii::internal::VectorOperations::Vector_copy<Number,Number2> copier(v.values, values);
internal::VectorOperations::parallel_for(copier,0,vec_size,thread_loop_partitioner);
return *this;
{
if (n==0)
{
- if (val) deallocate();
- val = nullptr;
+ if (values) deallocate();
+ values = nullptr;
max_vec_size = vec_size = 0;
thread_loop_partitioner.reset(new parallel::internal::TBBPartitioner());
return;
if (n>max_vec_size)
{
- if (val) deallocate();
+ if (values) deallocate();
max_vec_size = n;
allocate();
};
if (v.vec_size==0)
{
- if (val) deallocate();
- val = nullptr;
+ if (values) deallocate();
+ values = nullptr;
max_vec_size = vec_size = 0;
return;
};
if (v.vec_size>max_vec_size)
{
- if (val) deallocate();
+ if (values) deallocate();
max_vec_size = v.vec_size;
allocate();
};
Assert (vec_size!=0, ExcEmptyObject());
for (size_type i=0; i<vec_size; ++i)
- if (val[i] != Number())
+ if (values[i] != Number())
return false;
return true;
}
Assert (vec_size!=0, ExcEmptyObject());
for (size_type i=0; i<vec_size; ++i)
- if ( ! internal::VectorOperations::is_non_negative (val[i]))
+ if ( ! internal::VectorOperations::is_non_negative (values[i]))
return false;
return true;
if (vec_size>0)
{
- internal::VectorOperations::Vector_set<Number> setter(s, val);
+ internal::VectorOperations::Vector_set<Number> setter(s, values);
internal::VectorOperations::parallel_for(setter,0,vec_size,thread_loop_partitioner);
}
Assert (vec_size!=0, ExcEmptyObject());
- internal::VectorOperations::Vectorization_multiply_factor<Number> vector_multiply(val, factor);
+ internal::VectorOperations::Vectorization_multiply_factor<Number> vector_multiply(values, factor);
internal::VectorOperations::parallel_for(vector_multiply,0,vec_size,thread_loop_partitioner);
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
- internal::VectorOperations::Vectorization_add_av<Number> vector_add_av(val, v.val, a);
+ internal::VectorOperations::Vectorization_add_av<Number> vector_add_av(values, v.values, a);
internal::VectorOperations::parallel_for(vector_add_av,0,vec_size,thread_loop_partitioner);
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
- internal::VectorOperations::Vectorization_sadd_xav<Number> vector_sadd_xav(val, v.val, a, x);
+ internal::VectorOperations::Vectorization_sadd_xav<Number> vector_sadd_xav(values, v.values, a, x);
internal::VectorOperations::parallel_for(vector_sadd_xav,0,vec_size,thread_loop_partitioner);
}
ExcDimensionMismatch(vec_size, v.size()));
Number sum;
- internal::VectorOperations::Dot<Number,Number2> dot(val, v.val);
+ internal::VectorOperations::Dot<Number,Number2> dot(values, v.values);
internal::VectorOperations::parallel_reduce (dot, 0, vec_size, sum, thread_loop_partitioner);
AssertIsFinite(sum);
Assert (vec_size!=0, ExcEmptyObject());
real_type sum;
- internal::VectorOperations::Norm2<Number,real_type> norm2(val);
+ internal::VectorOperations::Norm2<Number,real_type> norm2(values);
internal::VectorOperations::parallel_reduce (norm2, 0, vec_size, sum, thread_loop_partitioner);
AssertIsFinite(sum);
Assert (vec_size!=0, ExcEmptyObject());
Number sum;
- internal::VectorOperations::MeanValue<Number> mean(val);
+ internal::VectorOperations::MeanValue<Number> mean(values);
internal::VectorOperations::parallel_reduce (mean, 0, vec_size, sum, thread_loop_partitioner);
return sum / real_type(size());
Assert (vec_size!=0, ExcEmptyObject());
real_type sum;
- internal::VectorOperations::Norm1<Number, real_type> norm1(val);
+ internal::VectorOperations::Norm1<Number, real_type> norm1(values);
internal::VectorOperations::parallel_reduce (norm1, 0, vec_size, sum, thread_loop_partitioner);
return sum;
Assert (vec_size!=0, ExcEmptyObject());
real_type norm_square;
- internal::VectorOperations::Norm2<Number, real_type> norm2(val);
+ internal::VectorOperations::Norm2<Number, real_type> norm2(values);
internal::VectorOperations::parallel_reduce (norm2, 0, vec_size, norm_square,
thread_loop_partitioner);
if (numbers::is_finite(norm_square) &&
real_type sum = 1.;
for (size_type i=0; i<vec_size; ++i)
{
- if (val[i] != Number())
+ if (values[i] != Number())
{
const real_type abs_x =
- numbers::NumberTraits<Number>::abs(val[i]);
+ numbers::NumberTraits<Number>::abs(values[i]);
if (scale < abs_x)
{
sum = 1. + sum * (scale/abs_x) * (scale/abs_x);
return l2_norm();
real_type sum;
- internal::VectorOperations::NormP<Number, real_type> normp(val, p);
+ internal::VectorOperations::NormP<Number, real_type> normp(values, p);
internal::VectorOperations::parallel_reduce (normp, 0, vec_size, sum, thread_loop_partitioner);
if (numbers::is_finite(sum) && sum >= std::numeric_limits<real_type>::min())
real_type sum = 1.;
for (size_type i=0; i<vec_size; ++i)
{
- if (val[i] != Number())
+ if (values[i] != Number())
{
const real_type abs_x =
- numbers::NumberTraits<Number>::abs(val[i]);
+ numbers::NumberTraits<Number>::abs(values[i]);
if (scale < abs_x)
{
sum = 1. + sum * std::pow(scale/abs_x, p);
real_type max = 0.;
for (size_type i=0; i<vec_size; ++i)
- max = std::max (numbers::NumberTraits<Number>::abs(val[i]), max);
+ max = std::max (numbers::NumberTraits<Number>::abs(values[i]), max);
return max;
}
AssertDimension (vec_size, W.size());
Number sum;
- internal::VectorOperations::AddAndDot<Number> adder(this->val, V.val, W.val, a);
+ internal::VectorOperations::AddAndDot<Number> adder(this->values, V.values, W.values, a);
internal::VectorOperations::parallel_reduce (adder, 0, vec_size, sum, thread_loop_partitioner);
AssertIsFinite(sum);
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
- internal::VectorOperations::Vectorization_add_v<Number> vector_add(val, v.val);
+ internal::VectorOperations::Vectorization_add_v<Number> vector_add(values, v.values);
internal::VectorOperations::parallel_for(vector_add,0,vec_size,thread_loop_partitioner);
return *this;
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
- internal::VectorOperations::Vectorization_subtract_v<Number> vector_subtract(val, v.val);
+ internal::VectorOperations::Vectorization_subtract_v<Number> vector_subtract(values, v.values);
internal::VectorOperations::parallel_for(vector_subtract,0,vec_size,thread_loop_partitioner);
return *this;
{
Assert (vec_size!=0, ExcEmptyObject());
- internal::VectorOperations::Vectorization_add_factor<Number> vector_add(val, v);
+ internal::VectorOperations::Vectorization_add_factor<Number> vector_add(values, v);
internal::VectorOperations::parallel_for(vector_add,0,vec_size,thread_loop_partitioner);
}
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
Assert (vec_size == w.vec_size, ExcDimensionMismatch(vec_size, w.vec_size));
- internal::VectorOperations::Vectorization_add_avpbw<Number> vector_add(val, v.val, w.val, a, b);
+ internal::VectorOperations::Vectorization_add_avpbw<Number> vector_add(values, v.values, w.values, a, b);
internal::VectorOperations::parallel_for(vector_add,0,vec_size,thread_loop_partitioner);
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
- internal::VectorOperations::Vectorization_sadd_xv<Number> vector_sadd(val, v.val, x);
+ internal::VectorOperations::Vectorization_sadd_xv<Number> vector_sadd(values, v.values, x);
internal::VectorOperations::parallel_for(vector_sadd,0,vec_size,thread_loop_partitioner);
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == s.vec_size, ExcDimensionMismatch(vec_size, s.vec_size));
- internal::VectorOperations::Vectorization_scale<Number> vector_scale(val, s.val);
+ internal::VectorOperations::Vectorization_scale<Number> vector_scale(values, s.values);
internal::VectorOperations::parallel_for(vector_scale,0,vec_size,thread_loop_partitioner);
}
Assert (vec_size == s.vec_size, ExcDimensionMismatch(vec_size, s.vec_size));
for (size_type i=0; i<vec_size; ++i)
- val[i] *= Number(s.val[i]);
+ values[i] *= Number(s.values[i]);
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == u.vec_size, ExcDimensionMismatch(vec_size, u.vec_size));
- internal::VectorOperations::Vectorization_equ_au<Number> vector_equ(val, u.val, a);
+ internal::VectorOperations::Vectorization_equ_au<Number> vector_equ(values, u.values, a);
internal::VectorOperations::parallel_for(vector_equ,0,vec_size,thread_loop_partitioner);
}
// operator*(complex<float>,complex<double>)
// is not defined by default
for (size_type i=0; i<vec_size; ++i)
- val[i] = a * Number(u.val[i]);
+ values[i] = a * Number(u.values[i]);
}
// we overwrite them anyway
reinit (a.size(), true);
- internal::VectorOperations::Vectorization_ratio<Number> vector_ratio(val, a.val, b.val);
+ internal::VectorOperations::Vectorization_ratio<Number> vector_ratio(values, a.values, b.values);
internal::VectorOperations::parallel_for(vector_ratio,0,vec_size,thread_loop_partitioner);
}
size_type this_index = 0;
for (size_type b=0; b<v.n_blocks(); ++b)
for (size_type i=0; i<v.block(b).size(); ++i, ++this_index)
- val[this_index] = v.block(b)(i);
+ values[this_index] = v.block(b)(i);
return *this;
}
// operator==(complex<float>,complex<double>)
// is not defined by default
for (size_type i=0; i<vec_size; ++i)
- if (val[i] != Number(v.val[i]))
+ if (values[i] != Number(v.values[i]))
return false;
return true;
Assert (vec_size!=0, ExcEmptyObject());
for (size_type j=0; j<size(); ++j)
- internal::VectorOperations::print (val[j], format);
+ internal::VectorOperations::print (values[j], format);
std::printf ("\n");
}
if (across)
for (size_type i=0; i<size(); ++i)
- out << val[i] << ' ';
+ out << values[i] << ' ';
else
for (size_type i=0; i<size(); ++i)
- out << val[i] << std::endl;
+ out << values[i] << std::endl;
out << std::endl;
AssertThrow (out, ExcIO());
if (across)
for (size_type i=0; i<size(); ++i)
- out << std::setw(width) << val[i] << ' ';
+ out << std::setw(width) << values[i] << ' ';
else
for (size_type i=0; i<size(); ++i)
- out << val[i] << std::endl;
+ out << values[i] << std::endl;
out << std::endl;
}
Vector<Number>::allocate()
{
// make sure that we don't create a memory leak
- Assert (val == nullptr, ExcInternalError());
+ Assert (values == nullptr, ExcInternalError());
// then allocate memory with the proper alignment requirements of 64 bytes
- Utilities::System::posix_memalign ((void **)&val, 64, sizeof(Number)*max_vec_size);
+ Utilities::System::posix_memalign ((void **)&values, 64, sizeof(Number)*max_vec_size);
}
void
Vector<Number>::deallocate()
{
- free(val);
- val = nullptr;
+ free(values);
+ values = nullptr;
}
DEAL_II_NAMESPACE_CLOSE
AssertDimension(v.size(), this->n_cols());
AssertDimension(w.size(), this->n_rows());
- gemv("N", &mm, &nn, &alpha, &this->values[0], &mm, v.val, &one, &beta, w.val, &one);
+ gemv("N", &mm, &nn, &alpha, &this->values[0], &mm, v.values, &one, &beta, w.values, &one);
break;
}
case svd:
AssertDimension(w.size(), this->n_rows());
// Compute V^T v
work.resize(std::max(mm,nn));
- gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.val, &one, &null, work.data(), &one);
+ gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.values, &one, &null, work.data(), &one);
// Multiply by singular values
for (size_type i=0; i<wr.size(); ++i)
work[i] *= wr[i];
// Multiply with U
- gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, work.data(), &one, &beta, w.val, &one);
+ gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, work.data(), &one, &beta, w.values, &one);
break;
}
case inverse_svd:
AssertDimension(v.size(), this->n_rows());
// Compute U^T v
work.resize(std::max(mm,nn));
- gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.val, &one, &null, work.data(), &one);
+ gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.values, &one, &null, work.data(), &one);
// Multiply by singular values
for (size_type i=0; i<wr.size(); ++i)
work[i] *= wr[i];
// Multiply with V
- gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, work.data(), &one, &beta, w.val, &one);
+ gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, work.data(), &one, &beta, w.values, &one);
break;
}
default:
AssertDimension(w.size(), this->n_cols());
AssertDimension(v.size(), this->n_rows());
- gemv("T", &mm, &nn, &alpha, &this->values[0], &mm, v.val, &one, &beta, w.val, &one);
+ gemv("T", &mm, &nn, &alpha, &this->values[0], &mm, v.values, &one, &beta, w.values, &one);
break;
}
case svd:
// Compute U^T v
work.resize(std::max(mm,nn));
- gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.val, &one, &null, work.data(), &one);
+ gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.values, &one, &null, work.data(), &one);
// Multiply by singular values
for (size_type i=0; i<wr.size(); ++i)
work[i] *= wr[i];
// Multiply with V
- gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, work.data(), &one, &beta, w.val, &one);
+ gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, work.data(), &one, &beta, w.values, &one);
break;
}
case inverse_svd:
// Compute V^T v
work.resize(std::max(mm,nn));
- gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.val, &one, &null, work.data(), &one);
+ gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.values, &one, &null, work.data(), &one);
// Multiply by singular values
for (size_type i=0; i<wr.size(); ++i)
work[i] *= wr[i];
// Multiply with U
- gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, work.data(), &one, &beta, w.val, &one);
+ gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, work.data(), &one, &beta, w.values, &one);
break;
}
default: