Skip to content

Commit 1c3307a

Browse files
committed
formatting cleanup + prune dead code
1 parent b8f1f3d commit 1c3307a

4 files changed

Lines changed: 4 additions & 37 deletions

File tree

btas/generic/converge_class.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace btas {
2626
public:
2727
/// constructor for the base convergence test object
2828
/// \param[in] tol tolerance for ALS convergence
29-
explicit NormCheck(double tol = 1e-3) : tol_(tol), iter_(0){
29+
explicit NormCheck(double tol = 1e-3) : tol_(tol), iter_(0) {
3030
}
3131

3232
~NormCheck() = default;

btas/generic/cp_als.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ namespace btas {
633633
contract(this->one, ai, {1, 2}, ai.conj(), {1, 3}, this->zero, AtA[i], {2, 3});
634634
}
635635
is_converged = converge_test(A, AtA);
636-
}while (count < max_als && !is_converged);
636+
} while (count < max_als && !is_converged);
637637

638638
detail::get_fit(converge_test, epsilon, (this->num_ALS == max_als));
639639
epsilon = 1.0 - epsilon;

btas/generic/cp_df_als.h

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -709,39 +709,6 @@ namespace btas {
709709
normCol(i);
710710
}
711711
}
712-
// else{
713-
/*for(size_t i = 0; i < this->ndim; ++i) {
714-
auto &a_prev = this->A[i];
715-
ind_t col_dim = a_prev.extent(0);
716-
ind_t prev_rank = a_prev.extent(1), smaller_rank = (prev_rank < rank ? prev_rank : rank),
717-
larger_rank = (smaller_rank == prev_rank ? rank : prev_rank);
718-
// If the new factor is bigger than the last add random cols
719-
if (larger_rank > smaller_rank) {
720-
Tensor a(col_dim, larger_rank);
721-
for (auto iter = a.begin(); iter != a.end(); ++iter) {
722-
*(iter) = distribution(generator);
723-
}
724-
auto lo_bound = {0l, 0l}, up_bound = {col_dim, smaller_rank};
725-
auto view = make_view(a.range().slice(lo_bound, up_bound), a.storage());
726-
// std::copy(view.begin(), view.end(), a_prev.begin());
727-
auto old = a_prev.begin();
728-
for (auto iter = view.begin(); iter != view.end(); ++iter, ++old) *(iter) += *(old);
729-
a_prev = a;
730-
}*/
731-
// Optional add a bump to the previous factors
732-
// } else{
733-
// for(auto & el : a_prev)
734-
// el += distribution(generator);
735-
// }
736-
//}
737-
/*A.pop_back();
738-
Tensor lambda(rank);
739-
lambda.fill(0.0);
740-
this->A.push_back(lambda);
741-
for (size_t i = 0; i < ndim; ++i) {
742-
normCol(i);
743-
}*/
744-
// }
745712
factors_set = true;
746713
ALS(rank, converge_test, max_als, calculate_epsilon, epsilon, fast_pI);
747714
}
@@ -801,7 +768,7 @@ namespace btas {
801768
is_converged = converge_test(A, this->AtA);
802769
if(count == 10)
803770
close_to_end_factors = this->A;
804-
}while (count < max_als && !is_converged);
771+
} while (count < max_als && !is_converged);
805772

806773
// Checks loss function if required
807774
detail::get_fit(converge_test, epsilon, (this->num_ALS == max_als));

btas/generic/tuck_cp_als.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ namespace btas{
207207
contract(this->one, tucker_factors[i], {1, 2}, ai.conj(), {2, 3}, this->zero, transformed_A[i], {1, 3});
208208
}
209209
is_converged = converge_test(A, AtA);
210-
}while (count < max_als && !is_converged);
210+
} while (count < max_als && !is_converged);
211211

212212
detail::get_fit(converge_test, epsilon, (this->num_ALS == max_als));
213213
epsilon = 1.0 - epsilon;

0 commit comments

Comments
 (0)