Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure for Kolmogorov-Smirnov tests, (tested!) methods for sampling with replacement, and changes to include guards #101

Merged
merged 9 commits into from
Jul 16, 2024
18 changes: 12 additions & 6 deletions RandBLAS/base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_base_hh
#define randblas_base_hh
#pragma once

/// @file

Expand All @@ -54,9 +53,18 @@
/// code common across the project
namespace RandBLAS {

/**
* Stores stride information for a matrix represented as a buffer.
* The intended semantics for a buffer "A" and the conceptualized
* matrix "mat(A)" are
*
* mat(A)[i, j] == A[i * inter_row_stride + j * inter_col_stride].
*
* for all (i, j) within the bounds of mat(A).
*/
struct stride_64t {
int64_t inter_row_stride;
int64_t inter_col_stride;
int64_t inter_row_stride; // step down a column
int64_t inter_col_stride; // step along a row
};

inline stride_64t layout_to_strides(blas::Layout layout, int64_t ldim) {
Expand Down Expand Up @@ -212,5 +220,3 @@ std::ostream &operator<<(
}

} // end namespace RandBLAS::base

#endif
5 changes: 1 addition & 4 deletions RandBLAS/config.h.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef RandBLAS_config_h
#define RandBLAS_config_h
#pragma once

#define RandBLAS_FULL_VERSION "@RandBLAS_FULL_VERSION@"
#define RandBLAS_VERSION_MAJOR @RandBLAS_VERSION_MAJOR@
Expand Down Expand Up @@ -53,5 +52,3 @@
//
// if you are linking to OpenMP.
//

#endif
6 changes: 1 addition & 5 deletions RandBLAS/dense_skops.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_dense_hh
#define randblas_dense_hh
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
Expand Down Expand Up @@ -640,5 +638,3 @@ RNGState<RNG> fill_dense(
}

} // end namespace RandBLAS

#endif
5 changes: 0 additions & 5 deletions RandBLAS/exceptions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@

#pragma once

#ifndef RandBLAS_EXCEPTIONS_HH
#define RandBLAS_EXCEPTIONS_HH

#include <exception>
#include <cstdarg>
#include <string>
Expand Down Expand Up @@ -164,5 +161,3 @@ inline void abort_if( bool cond, const char* func, const char* format, ... ) {
#endif

} // namespace RandBLAS::exceptions

#endif
4 changes: 1 addition & 3 deletions RandBLAS/random_gen.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef random_gen_hh
#define random_gen_hh
#pragma once

/// @file

Expand Down Expand Up @@ -178,4 +177,3 @@ struct uneg11

} // end of namespace r123ext

#endif
7 changes: 1 addition & 6 deletions RandBLAS/skge.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_skge_hh
#define randblas_skge_hh
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
Expand Down Expand Up @@ -1231,6 +1229,3 @@ inline void sketch_general(
};

} // end namespace RandBLAS


#endif
4 changes: 1 addition & 3 deletions RandBLAS/sksy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sksy_hh
#define randblas_sksy_hh
#pragma once

#include "RandBLAS/util.hh"
#include "RandBLAS/base.hh"
Expand Down Expand Up @@ -538,4 +537,3 @@ inline void sketch_symmetric(
}

} // end namespace RandBLAS
#endif
5 changes: 1 addition & 4 deletions RandBLAS/skve.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_skve_hh
#define randblas_skve_hh
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
Expand Down Expand Up @@ -260,4 +258,3 @@ inline void sketch_vector(
}

} // end namespace RandBLAS
#endif
8 changes: 1 addition & 7 deletions RandBLAS/sparse_data/base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_data_hh
#define randblas_sparse_data_hh
#pragma once

#include "RandBLAS/config.h"
#include "RandBLAS/base.hh"
Expand Down Expand Up @@ -193,7 +191,3 @@ namespace RandBLAS {
using RandBLAS::sparse_data::IndexBase;
using RandBLAS::sparse_data::SparseMatrix;
}



#endif
5 changes: 1 addition & 4 deletions RandBLAS/sparse_data/conversions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
#pragma once

#ifndef randblas_sparse_data_conversions
#define randblas_sparse_data_conversions
#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
#include "RandBLAS/sparse_data/base.hh"
Expand Down Expand Up @@ -209,5 +208,3 @@ void reindex_inplace(COOMatrix<T> &A, IndexBase desired) {
}

} // end namespace RandBLAS::sparse_data::conversions

#endif
5 changes: 2 additions & 3 deletions RandBLAS/sparse_data/coo_matrix.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_data_coo
#define randblas_sparse_data_coo
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
#include "RandBLAS/sparse_data/base.hh"
Expand Down Expand Up @@ -409,4 +409,3 @@ void coo_to_dense(const COOMatrix<T> &spmat, Layout layout, T *mat) {

} // end namespace RandBLAS::sparse_data::coo

#endif
6 changes: 2 additions & 4 deletions RandBLAS/sparse_data/coo_spmm_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_data_coo_multiply
#define randblas_sparse_data_coo_multiply
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
#include "RandBLAS/sparse_data/base.hh"
Expand Down Expand Up @@ -163,5 +163,3 @@ static void apply_coo_left_jki_p11(


} // end namespace

#endif
9 changes: 3 additions & 6 deletions RandBLAS/sparse_data/csc_matrix.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_data_csc
#define randblas_sparse_data_csc
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
#include "RandBLAS/sparse_data/base.hh"
Expand Down Expand Up @@ -246,7 +246,4 @@ void dense_to_csc(Layout layout, T* mat, T abs_tol, CSCMatrix<T> &spmat) {
return;
}


}

#endif
} // end namespace RandBLAS::sparse_data::csc
6 changes: 2 additions & 4 deletions RandBLAS/sparse_data/csc_spmm_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_data_csc_multiply
#define randblas_sparse_data_csc_multiply
#pragma once
#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
#include "RandBLAS/sparse_data/base.hh"
Expand Down Expand Up @@ -213,5 +212,4 @@ static void apply_csc_left_kib_rowmajor_1p1(
return;
}

}
#endif
} // end namespace RandBLAS::sparse_data::csc
5 changes: 2 additions & 3 deletions RandBLAS/sparse_data/csr_matrix.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_data_csr
#define randblas_sparse_data_csr
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
#include "RandBLAS/sparse_data/base.hh"
Expand Down Expand Up @@ -262,4 +262,3 @@ void dense_to_csr(Layout layout, T* mat, T abs_tol, CSRMatrix<T> &spmat) {


} // end namespace RandBLAS::sparse_data::csr
#endif
6 changes: 2 additions & 4 deletions RandBLAS/sparse_data/csr_spmm_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_data_csr_multiply
#define randblas_sparse_data_csr_multiply
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
#include "RandBLAS/sparse_data/base.hh"
Expand Down Expand Up @@ -156,5 +156,3 @@ static void apply_csr_left_ikb_rowmajor(
}

} // end namespace RandBLAS::sparse_data::csr

#endif
6 changes: 1 addition & 5 deletions RandBLAS/sparse_data/sksp.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sksp_hh
#define randblas_sksp_hh
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/dense_skops.hh"
Expand Down Expand Up @@ -625,6 +624,3 @@ inline void sketch_sparse(
}

} // end namespace RandBLAS


#endif
6 changes: 2 additions & 4 deletions RandBLAS/sparse_data/spmm_dispatch.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_data_spmm_dispatch
#define randblas_sparse_data_spmm_dispatch
#pragma once

#include "RandBLAS/base.hh"
#include "RandBLAS/exceptions.hh"
#include "RandBLAS/sparse_data/base.hh"
Expand Down Expand Up @@ -384,5 +384,3 @@ inline void spmm(blas::Layout layout, blas::Op opA, blas::Op opB, int64_t m, int
}

}

#endif
6 changes: 1 addition & 5 deletions RandBLAS/sparse_skops.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//

#ifndef randblas_sparse_skops_hh
#define randblas_sparse_skops_hh
#pragma once

#include "RandBLAS/config.h"
#include "RandBLAS/base.hh"
Expand Down Expand Up @@ -483,5 +481,3 @@ static auto transpose(SKOP const &S) {
}

} // end namespace RandBLAS::sparse

#endif
Loading
Loading