mirror of
https://github.com/Relintai/pmlpp.git
synced 2024-11-08 13:12:09 +01:00
Added static create helper methods to Vector.
This commit is contained in:
parent
fbfd546ee8
commit
d39291c849
@ -927,6 +927,34 @@ Ref<MLPPVector> MLPPVector::vecn_full(int n, int k) const {
|
||||
return vec;
|
||||
}
|
||||
|
||||
Ref<MLPPVector> MLPPVector::create_vec_zero(int n) {
|
||||
Ref<MLPPVector> vec;
|
||||
vec.instance();
|
||||
|
||||
vec->resize(n);
|
||||
vec->fill(0);
|
||||
|
||||
return vec;
|
||||
}
|
||||
Ref<MLPPVector> MLPPVector::create_vec_one(int n) {
|
||||
Ref<MLPPVector> vec;
|
||||
vec.instance();
|
||||
|
||||
vec->resize(n);
|
||||
vec->fill(1);
|
||||
|
||||
return vec;
|
||||
}
|
||||
Ref<MLPPVector> MLPPVector::create_vec_full(int n, int k) {
|
||||
Ref<MLPPVector> vec;
|
||||
vec.instance();
|
||||
|
||||
vec->resize(n);
|
||||
vec->fill(k);
|
||||
|
||||
return vec;
|
||||
}
|
||||
|
||||
void MLPPVector::sin() {
|
||||
real_t *out_ptr = ptrw();
|
||||
|
||||
|
@ -181,6 +181,10 @@ public:
|
||||
Ref<MLPPVector> vecn_one(int n) const;
|
||||
Ref<MLPPVector> vecn_full(int n, int k) const;
|
||||
|
||||
static Ref<MLPPVector> create_vec_zero(int n);
|
||||
static Ref<MLPPVector> create_vec_one(int n);
|
||||
static Ref<MLPPVector> create_vec_full(int n, int k);
|
||||
|
||||
void sin();
|
||||
Ref<MLPPVector> sinn() const;
|
||||
void sinb(const Ref<MLPPVector> &a);
|
||||
|
Loading…
Reference in New Issue
Block a user