Commit a1c6a3ec authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added todo

parent ad7ff5ab
......@@ -2,68 +2,69 @@
RVector MOCE(RVector &toepRow, RVector &toepCol) {
RVector circRow(toepRow.size() + toepCol.size() - 1);
circRow.insert(toepRow, 0);
std::vector<double> temp(toepCol.rbegin(), toepCol.rend() - 1);
circRow.insert(RVector(std::move(temp)), toepRow.size());
return circRow;
RVector circRow(toepRow.size() + toepCol.size() - 1);
circRow.insert(toepRow, 0);
std::vector<double> temp(toepCol.rbegin(), toepCol.rend() - 1);
circRow.insert(RVector(std::move(temp)), toepRow.size());
return circRow;
}
RMatrix BMOCE(RMatrix &toepRows, RMatrix &toepCols) {
int circSize = toepRows.rows() + toepCols.rows() - 1;
RMatrix circRows(circSize, circSize);
for (int i = 0; i < circSize; i++) {
RVector toepRow = toepRows.row(i);
RVector toepCol = toepCols.row(i);
RVector circRow = MOCE(toepRow, toepCol);
circRows.InsertRow(circRow, i);
}
for (int i = 0; i < toepRows.rows() - 1; i++) {
RVector circRow = circRows.row(toepRows.rows() - 1 - i);
circRows.InsertRow(circRow, toepRows.rows() + i);
}
return circRows;
int circSize = toepRows.rows() + toepCols.rows() - 1;
RMatrix circRows(circSize, circSize);
// todo for (int i = 0; i < toepRows.rows(); i++) {
for (int i = 0; i < circSize; i++) {
RVector toepRow = toepRows.row(i);
RVector toepCol = toepCols.row(i);
RVector circRow = MOCE(toepRow, toepCol);
circRows.InsertRow(circRow, i);
}
for (int i = 0; i < toepRows.rows() - 1; i++) {
RVector circRow = circRows.row(toepRows.rows() - 1 - i);
circRows.InsertRow(circRow, toepRows.rows() + i);
}
return circRows;
}
void CovarianceFunction1D::ToeplitzMatrix(CovarianceFunction1D::T &toepRow,
CovarianceFunction1D::T &toepCol) {
RVector firstCoord(linspace(0, 1, toepRow.size()));
double y_rows = firstCoord.front();
RVector firstCoord(linspace(0, 1, toepRow.size()));
double y_rows = firstCoord.front();
for (int index_c = 0; index_c < toepRow.size(); index_c++) {
double c1 = firstCoord[index_c];
double x_rows = c1;
double tau_rows = x_rows - y_rows;
for (int index_c = 0; index_c < toepRow.size(); index_c++) {
double c1 = firstCoord[index_c];
double x_rows = c1;
double tau_rows = x_rows - y_rows;
double x_columns = firstCoord.front();
double y_columns = c1;
double tau_columns = x_columns - y_columns;
double x_columns = firstCoord.front();
double y_columns = c1;
double tau_columns = x_columns - y_columns;
toepRow[index_c] = Function(&tau_rows);
toepCol[index_c] = Function(&tau_columns);
}
toepRow[index_c] = Function(&tau_rows);
toepCol[index_c] = Function(&tau_columns);
}
}
void CovarianceFunction2D::ToeplitzMatrix(CovarianceFunction2D::T &toepRows,
CovarianceFunction2D::T &toepCols) {
RVector coordinate1(linspace(0, 1, toepRows.rows()));
RVector coordinate2(linspace(0, 1, toepCols.rows()));
RVector coordinate1(linspace(0, 1, toepRows.rows()));
RVector coordinate2(linspace(0, 1, toepCols.rows()));
double y_rows[2] = {coordinate1.front(), coordinate2.front()};
for (int index_c2 = 0; index_c2 < toepRows.rows(); index_c2++) {
for (int index_c1 = 0; index_c1 < toepRows.rows(); index_c1++) {
double c1 = coordinate1[index_c1];
double c2 = coordinate2[index_c2];
double x_rows[2] = {c1, c2};
double tau_rows[2] = {x_rows[0] - y_rows[0], x_rows[1] - y_rows[1]};
double y_rows[2] = {coordinate1.front(), coordinate2.front()};
for (int index_c2 = 0; index_c2 < toepRows.rows(); index_c2++) {
for (int index_c1 = 0; index_c1 < toepRows.rows(); index_c1++) {
double c1 = coordinate1[index_c1];
double c2 = coordinate2[index_c2];
double x_rows[2] = {c1, c2};
double tau_rows[2] = {x_rows[0] - y_rows[0], x_rows[1] - y_rows[1]};
double x_columns[2] = {coordinate1.front(), c2};
double y_columns[2] = {c1, coordinate2.front()};
double tau_columns[2] = {x_columns[0] - y_columns[0],
x_columns[1] - y_columns[1]};
double x_columns[2] = {coordinate1.front(), c2};
double y_columns[2] = {c1, coordinate2.front()};
double tau_columns[2] = {x_columns[0] - y_columns[0],
x_columns[1] - y_columns[1]};
toepCols[index_c2][index_c1] = Function(tau_columns);
toepRows[index_c2][index_c1] = Function(tau_rows);
}
toepCols[index_c2][index_c1] = Function(tau_columns);
toepRows[index_c2][index_c1] = Function(tau_rows);
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment