Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
feat: format files
Browse files Browse the repository at this point in the history
  • Loading branch information
tiankaima committed Jan 3, 2024
1 parent 52800ea commit f4f1c41
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Matrix/MatrixProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void Matrix::print() {
for (ull i = 0; i < this->rows; i++) {
std::cout << "[";
for (ull j = 0; j < this->cols; j++) {
if(std::abs(this->matrix[i][j]) < 1e-10 && HIDE_ZERO_IN_MATRIX_PRINT) {
if (std::abs(this->matrix[i][j]) < 1e-10 && HIDE_ZERO_IN_MATRIX_PRINT) {
std::cout << "\t" << " " << "\t";
} else {
std::cout << "\t" << this->matrix[i][j] << "\t";
Expand Down
4 changes: 2 additions & 2 deletions lib/SVDMethod/SVDMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PolarDecomposition2D_Result PolarDecomposition2D(const Matrix &A) {
auto c = x / r;
auto s = y / r;
auto R = Matrix(std::vector<std::vector<lld>>{
{c, -s},
{c, -s},
{s, c}
});
auto S = R.transpose() * A;
Expand Down Expand Up @@ -208,7 +208,7 @@ SVDMethod_Result SVDMethod(const Matrix &matrix) {
B.set(pivot_i, pivot_j, pivot_j, pivot_j, r.B);
auto G_expanded = Matrix::identity(m);
G_expanded.set(pivot_i, pivot_j, pivot_i, pivot_j, r.G);
U = G_expanded * U ;
U = G_expanded * U;
} else {
auto r = WilkinsonShiftIteration(B22);
B.set(pivot_i, pivot_j, pivot_i, pivot_j, r.B);
Expand Down
1 change: 1 addition & 0 deletions lib/SVDMethod/SVDMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ typedef struct {
} WilkinsonShift_Result;

WilkinsonShift_Result WilkinsonShiftIteration2D(const Matrix &A);

WilkinsonShift_Result WilkinsonShiftIteration(const Matrix &matrix);

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion lib/Vector/Vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void Vector::print() {

std::cout << "[";
for (int i = 0; i < this->size; i++) {
if(std::abs(this->array[i]) < 1e-10 && HIDE_ZERO_IN_VECTOR_PRINT) {
if (std::abs(this->array[i]) < 1e-10 && HIDE_ZERO_IN_VECTOR_PRINT) {
std::cout << "\t" << " " << "\t";
} else {
std::cout << "\t" << this->array[i] << "\t";
Expand Down
2 changes: 1 addition & 1 deletion lib/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define NUMERICAL_ALGEBRA_BASE_H

#define ENABLE_TIMING
#define ITERATION_METHOD_MAX_ITERATION 10000000
#define ITERATION_METHOD_MAX_ITERATION 100000

#include "iostream"
#include "iomanip"
Expand Down

0 comments on commit f4f1c41

Please sign in to comment.