Skip to content

Commit

Permalink
fix possible subtle conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAD committed Nov 23, 2023
1 parent 143db33 commit 60fc139
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions OndselSolver/EulerParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace MbD {
FMatFColDsptr EulerParameters<T>::ppApEpEtimesColumn(FColDsptr col) {
(void) col; // to suppress compiler warning of unused parameters
assert(false);
return {};
}
template<>
FMatFColDsptr EulerParameters<double>::ppApEpEtimesColumn(FColDsptr col)
Expand Down Expand Up @@ -65,6 +66,7 @@ namespace MbD {
{
(void) col; // to suppress compiler warning of unused parameters
assert(false);
return {};
}
template<>
FMatDsptr EulerParameters<double>::pCpEtimesColumn(FColDsptr col)
Expand Down Expand Up @@ -135,6 +137,7 @@ namespace MbD {
{
(void) mat; // to suppress compiler warning of unused parameters
assert(false);
return {};
}
template<>
FMatFMatDsptr EulerParameters<double>::ppApEpEtimesMatrix(FMatDsptr mat)
Expand Down
19 changes: 12 additions & 7 deletions OndselSolver/FullColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ namespace MbD {
template<typename T>
void FullColumn<T>::atiputFullColumn(int i, FColsptr<T> fullCol)
{
for (size_t ii = 0; ii < fullCol->size(); ii++)
int n = (int)fullCol->size();
for (int ii = 0; ii < n; ii++)
{
this->at(i + ii) = fullCol->at(ii);
}
}
template<typename T>
void FullColumn<T>::atiplusFullColumn(int i, FColsptr<T> fullCol)
{
for (size_t ii = 0; ii < fullCol->size(); ii++)
int n = (int)fullCol->size();
for (int ii = 0; ii < n; ii++)
{
this->at(i + ii) += fullCol->at(ii);
}
Expand All @@ -76,15 +78,17 @@ namespace MbD {
void FullColumn<T>::equalSelfPlusFullColumnAt(FColsptr<T> fullCol, int ii)
{
//self is subcolumn of fullCol
for (size_t i = 0; i < this->size(); i++)
int n = (int) this->size();
for (int i = 0; i < n; i++)
{
this->at(i) += fullCol->at(ii + i);
}
}
template<typename T>
void FullColumn<T>::atiminusFullColumn(int i1, FColsptr<T> fullCol)
{
for (size_t ii = 0; ii < fullCol->size(); ii++)
int n = fullCol->size();
for (int ii = 0; ii < n; ii++)
{
int i = i1 + ii;
this->at(i) -= fullCol->at(ii);
Expand All @@ -94,15 +98,15 @@ namespace MbD {
void FullColumn<T>::equalFullColumnAt(FColsptr<T> fullCol, int i)
{
this->equalArrayAt(fullCol, i);
//for (size_t ii = 0; ii < this->size(); ii++)
//for (int ii = 0; ii < this->size(); ii++)
//{
// this->at(ii) = fullCol->at(i + ii);
//}
}
template<>
FColDsptr FullColumn<double>::copy()
{
auto n = (int) this->size();
int n = (int) this->size();
auto answer = std::make_shared<FullColumn<double>>(n);
for (int i = 0; i < n; i++)
{
Expand All @@ -129,7 +133,8 @@ namespace MbD {
template<typename T>
void FullColumn<T>::atiplusFullColumntimes(int i1, FColsptr<T> fullCol, T factor)
{
for (size_t ii = 0; ii < fullCol->size(); ii++)
int n = fullCol->size();
for (int ii = 0; ii < n; ii++)
{
int i = i1 + ii;
this->at(i) += fullCol->at(ii) * factor;
Expand Down

0 comments on commit 60fc139

Please sign in to comment.