dense AD: fix a few stupid bugs
e.g., looping over the wrong range or an infinite loop. also, the dense-AD unit test is shortend to test one specialization and the unspecialized class.
This commit is contained in:
@@ -161,8 +161,10 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
|
||||
for (int i = dstart_; i < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -219,7 +221,7 @@ public:
|
||||
|
||||
// derivatives
|
||||
|
||||
for (int i = 0; i < length_; ++i)
|
||||
for (int i = dstart_; i < dend_; ++i)
|
||||
this->data_[i] = this->data_[i]*v + other.data_[i] * u;
|
||||
|
||||
|
||||
@@ -250,7 +252,7 @@ public:
|
||||
|
||||
// derivatives
|
||||
|
||||
for (int i = 0; i < length_; ++i)
|
||||
for (int i = dstart_; i < dend_; ++i)
|
||||
data_[i] = data_[i]*v_vv - other.data_[i]*u_vv;
|
||||
|
||||
|
||||
|
||||
@@ -159,8 +159,10 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -177,8 +177,19 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
data_[5] = other.data_[5];
|
||||
data_[6] = other.data_[6];
|
||||
data_[7] = other.data_[7];
|
||||
data_[8] = other.data_[8];
|
||||
data_[9] = other.data_[9];
|
||||
data_[10] = other.data_[10];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -179,8 +179,20 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
data_[5] = other.data_[5];
|
||||
data_[6] = other.data_[6];
|
||||
data_[7] = other.data_[7];
|
||||
data_[8] = other.data_[8];
|
||||
data_[9] = other.data_[9];
|
||||
data_[10] = other.data_[10];
|
||||
data_[11] = other.data_[11];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -181,8 +181,21 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
data_[5] = other.data_[5];
|
||||
data_[6] = other.data_[6];
|
||||
data_[7] = other.data_[7];
|
||||
data_[8] = other.data_[8];
|
||||
data_[9] = other.data_[9];
|
||||
data_[10] = other.data_[10];
|
||||
data_[11] = other.data_[11];
|
||||
data_[12] = other.data_[12];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -161,8 +161,11 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -163,8 +163,12 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -165,8 +165,13 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -167,8 +167,14 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
data_[5] = other.data_[5];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -169,8 +169,15 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
data_[5] = other.data_[5];
|
||||
data_[6] = other.data_[6];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -171,8 +171,16 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
data_[5] = other.data_[5];
|
||||
data_[6] = other.data_[6];
|
||||
data_[7] = other.data_[7];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -173,8 +173,17 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
data_[5] = other.data_[5];
|
||||
data_[6] = other.data_[6];
|
||||
data_[7] = other.data_[7];
|
||||
data_[8] = other.data_[8];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -175,8 +175,18 @@ public:
|
||||
// copy all derivatives from other
|
||||
void copyDerivatives(const Evaluation& other)
|
||||
{
|
||||
for (int i = dstart_; 0 < dend_; ++i)
|
||||
data_[i] = other.data_[i];
|
||||
|
||||
|
||||
data_[1] = other.data_[1];
|
||||
data_[2] = other.data_[2];
|
||||
data_[3] = other.data_[3];
|
||||
data_[4] = other.data_[4];
|
||||
data_[5] = other.data_[5];
|
||||
data_[6] = other.data_[6];
|
||||
data_[7] = other.data_[7];
|
||||
data_[8] = other.data_[8];
|
||||
data_[9] = other.data_[9];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user