... | ... |
@@ -20,7 +20,6 @@ |
20 | 20 |
#' @param nEquil number of iterations for burn-in |
21 | 21 |
#' @param nSample number of iterations for sampling |
22 | 22 |
#' @param nOutputs how often to print status into R by iterations |
23 |
-#' @param nSnapshots the number of individual samples to capture |
|
24 | 23 |
#' @param alphaA sparsity parameter for A domain |
25 | 24 |
#' @param alphaP sparsity parameter for P domain |
26 | 25 |
#' @param maxGibbmassA limit truncated normal to max size |
... | ... |
@@ -116,21 +115,20 @@ checkpointFile="gaps_checkpoint.out", nCores=1, ...) |
116 | 115 |
#' continues the run from that point |
117 | 116 |
#' @param D data matrix |
118 | 117 |
#' @param S uncertainty matrix |
118 |
+#' @param nFactor number of patterns |
|
119 |
+#' @param nIter number of iterations |
|
120 |
+#' @param checkpointFile path to checkpoint file |
|
119 | 121 |
#' @param path path to checkpoint file |
120 |
-#' @param checkpointFile name for future checkpooints made |
|
121 | 122 |
#' @return list with A and P matrix estimates |
122 | 123 |
#' @examples |
123 | 124 |
#' data(SimpSim) |
124 | 125 |
#' result <- CoGAPS(SimpSim.D, SimpSim.S, nFactor=3, nOutputs=250) |
125 |
-CoGapsFromCheckpoint <- function(D, S, path, checkpointFile=NA) |
|
126 |
+CoGapsFromCheckpoint <- function(D, S, nFactor, nIter, checkpointFile) |
|
126 | 127 |
{ |
127 |
- if (is.na(checkpointFile)) |
|
128 |
- checkpointFile <- path |
|
129 |
- cogapsFromCheckpoint_cpp(D, S, path, checkpointFile) |
|
128 |
+ cogapsFromCheckpoint_cpp(D, S, nFactor, nIter, nIter, checkpointFile) |
|
130 | 129 |
} |
131 | 130 |
|
132 | 131 |
#' CoGAPS with file input for matrix |
133 |
-#' @export |
|
134 | 132 |
#' |
135 | 133 |
#' @param D file path for data matrix |
136 | 134 |
#' @return list with A and P matrix estimates |
... | ... |
@@ -1,12 +1,25 @@ |
1 | 1 |
# Generated by using Rcpp::compileAttributes() -> do not edit by hand |
2 | 2 |
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 |
3 | 3 |
|
4 |
+<<<<<<< HEAD |
|
4 | 5 |
cogapsFromFile_cpp <- function(D, nPatterns, maxIter, outputFrequency, seed, alphaA, alphaP, maxGibbsMassA, maxGibbsMassP, messages, singleCellRNASeq) { |
5 | 6 |
.Call('_CoGAPS_cogapsFromFile_cpp', PACKAGE = 'CoGAPS', D, nPatterns, maxIter, outputFrequency, seed, alphaA, alphaP, maxGibbsMassA, maxGibbsMassP, messages, singleCellRNASeq) |
6 | 7 |
} |
7 | 8 |
|
8 | 9 |
cogaps_cpp <- function(D, nPatterns, maxIter, outputFrequency, seed, alphaA, alphaP, maxGibbsMassA, maxGibbsMassP, messages, singleCellRNASeq, nCores) { |
9 | 10 |
.Call('_CoGAPS_cogaps_cpp', PACKAGE = 'CoGAPS', D, nPatterns, maxIter, outputFrequency, seed, alphaA, alphaP, maxGibbsMassA, maxGibbsMassP, messages, singleCellRNASeq, nCores) |
11 |
+======= |
|
12 |
+cogaps_cpp <- function(D, S, nFactor, nEquil, nEquilCool, nSample, nOutputs, alphaA, alphaP, maxGibbmassA, maxGibbmassP, seed, messages, singleCellRNASeq, whichMatrixFixed, FP, checkpointInterval, cptFile, pumpThreshold, nPumpSamples, nCores) { |
|
13 |
+ .Call('_CoGAPS_cogaps_cpp', PACKAGE = 'CoGAPS', D, S, nFactor, nEquil, nEquilCool, nSample, nOutputs, alphaA, alphaP, maxGibbmassA, maxGibbmassP, seed, messages, singleCellRNASeq, whichMatrixFixed, FP, checkpointInterval, cptFile, pumpThreshold, nPumpSamples, nCores) |
|
14 |
+} |
|
15 |
+ |
|
16 |
+cogapsFromCheckpoint_cpp <- function(D, S, nFactor, nEquil, nSample, cptFile) { |
|
17 |
+ .Call('_CoGAPS_cogapsFromCheckpoint_cpp', PACKAGE = 'CoGAPS', D, S, nFactor, nEquil, nSample, cptFile) |
|
18 |
+} |
|
19 |
+ |
|
20 |
+cogapsFromFile_cpp <- function(D) { |
|
21 |
+ invisible(.Call('_CoGAPS_cogapsFromFile_cpp', PACKAGE = 'CoGAPS', D)) |
|
22 |
+>>>>>>> develop |
|
10 | 23 |
} |
11 | 24 |
|
12 | 25 |
getBuildReport_cpp <- function() { |
... | ... |
@@ -639,6 +639,7 @@ ac_subst_files='' |
639 | 639 |
ac_user_opts=' |
640 | 640 |
enable_option_checking |
641 | 641 |
enable_debug |
642 |
+enable_debug_tsan |
|
642 | 643 |
enable_warnings |
643 | 644 |
enable_simd |
644 | 645 |
' |
... | ... |
@@ -1273,6 +1274,7 @@ Optional Features: |
1273 | 1274 |
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) |
1274 | 1275 |
--enable-FEATURE[=ARG] include FEATURE [ARG=yes] |
1275 | 1276 |
--enable-debug build debug version of CoGAPS |
1277 |
+ --enable-debug-tsan build debug version of CoGAPS |
|
1276 | 1278 |
--enable-warnings compile CoGAPS with warning messages |
1277 | 1279 |
--enable-simd specify simd instruction set (sse, avx) |
1278 | 1280 |
|
... | ... |
@@ -2984,6 +2986,15 @@ else |
2984 | 2986 |
fi |
2985 | 2987 |
|
2986 | 2988 |
|
2989 |
+# Check if compiling debug version with thread sanitizer |
|
2990 |
+# Check whether --enable-debug_tsan was given. |
|
2991 |
+if test "${enable_debug_tsan+set}" = set; then : |
|
2992 |
+ enableval=$enable_debug_tsan; build_debug_tsan=yes |
|
2993 |
+else |
|
2994 |
+ build_debug_tsan=no |
|
2995 |
+fi |
|
2996 |
+ |
|
2997 |
+ |
|
2987 | 2998 |
# Check if compiler warnings should be turned on |
2988 | 2999 |
# Check whether --enable-warnings was given. |
2989 | 3000 |
if test "${enable_warnings+set}" = set; then : |
... | ... |
@@ -4177,7 +4188,21 @@ echo "building on $ax_cv_cxx_compiler_vendor compiler version $ax_cv_cxx_compile |
4177 | 4188 |
# set compile flags for debug build |
4178 | 4189 |
if test "x$build_debug" = "xyes" ; then |
4179 | 4190 |
echo "Building Debug Version of CoGAPS" |
4180 |
- GAPS_CPP_FLAGS+=" -DGAPS_DEBUG " |
|
4191 |
+ GAPS_CPP_FLAGS+=" -DGAPS_DEBUG -fno-omit-frame-pointer " |
|
4192 |
+ if test "x$ax_cv_cxx_compiler_vendor" = "xclang" ; then |
|
4193 |
+ GAPS_CPP_FLAGS+=" -fsanitize=address -fsanitize=undefined " |
|
4194 |
+ GAPS_LIBS+=" -fsanitize=address -fsanitize=undefined " |
|
4195 |
+ elif test "x$ax_cv_cxx_compiler_vendor" = "xgnu" ; then |
|
4196 |
+ GAPS_CPP_FLAGS+=" -fsanitize=address -fsanitize=undefined " |
|
4197 |
+ GAPS_LIBS+=" -fsanitize=address -fsanitize=undefined " |
|
4198 |
+ fi |
|
4199 |
+elif test "x$build_debug_tsan" = "xyes" ; then |
|
4200 |
+ echo "Building Debug Version of CoGAPS with thread sanitizer" |
|
4201 |
+ GAPS_CPP_FLAGS+=" -DGAPS_DEBUG -fno-omit-frame-pointer " |
|
4202 |
+ if test "x$ax_cv_cxx_compiler_vendor" = "xclang" ; then |
|
4203 |
+ GAPS_CPP_FLAGS+=" -fsanitize=thread " |
|
4204 |
+ GAPS_LIBS+=" -fsanitize=thread " |
|
4205 |
+ fi |
|
4181 | 4206 |
fi |
4182 | 4207 |
|
4183 | 4208 |
# set compile flags if warnings enabled |
... | ... |
@@ -19,6 +19,10 @@ AC_PROG_CXX |
19 | 19 |
AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], |
20 | 20 |
[build debug version of CoGAPS])], [build_debug=yes], [build_debug=no]) |
21 | 21 |
|
22 |
+# Check if compiling debug version with thread sanitizer |
|
23 |
+AC_ARG_ENABLE(debug_tsan, [AC_HELP_STRING([--enable-debug-tsan], |
|
24 |
+ [build debug version of CoGAPS])], [build_debug_tsan=yes], [build_debug_tsan=no]) |
|
25 |
+ |
|
22 | 26 |
# Check if compiler warnings should be turned on |
23 | 27 |
AC_ARG_ENABLE(warnings, [AC_HELP_STRING([--enable-warnings], |
24 | 28 |
[compile CoGAPS with warning messages])], [warnings=yes], [warnings=no]) |
... | ... |
@@ -47,7 +51,21 @@ echo "building on $ax_cv_cxx_compiler_vendor compiler version $ax_cv_cxx_compile |
47 | 51 |
# set compile flags for debug build |
48 | 52 |
if test "x$build_debug" = "xyes" ; then |
49 | 53 |
echo "Building Debug Version of CoGAPS" |
50 |
- GAPS_CPP_FLAGS+=" -DGAPS_DEBUG " |
|
54 |
+ GAPS_CPP_FLAGS+=" -DGAPS_DEBUG -fno-omit-frame-pointer " |
|
55 |
+ if test "x$ax_cv_cxx_compiler_vendor" = "xclang" ; then |
|
56 |
+ GAPS_CPP_FLAGS+=" -fsanitize=address -fsanitize=undefined " |
|
57 |
+ GAPS_LIBS+=" -fsanitize=address -fsanitize=undefined " |
|
58 |
+ elif test "x$ax_cv_cxx_compiler_vendor" = "xgnu" ; then |
|
59 |
+ GAPS_CPP_FLAGS+=" -fsanitize=address -fsanitize=undefined " |
|
60 |
+ GAPS_LIBS+=" -fsanitize=address -fsanitize=undefined " |
|
61 |
+ fi |
|
62 |
+elif test "x$build_debug_tsan" = "xyes" ; then |
|
63 |
+ echo "Building Debug Version of CoGAPS with thread sanitizer" |
|
64 |
+ GAPS_CPP_FLAGS+=" -DGAPS_DEBUG -fno-omit-frame-pointer " |
|
65 |
+ if test "x$ax_cv_cxx_compiler_vendor" = "xclang" ; then |
|
66 |
+ GAPS_CPP_FLAGS+=" -fsanitize=thread " |
|
67 |
+ GAPS_LIBS+=" -fsanitize=thread " |
|
68 |
+ fi |
|
51 | 69 |
fi |
52 | 70 |
|
53 | 71 |
# set compile flags if warnings enabled |
... | ... |
@@ -5,11 +5,19 @@ |
5 | 5 |
\title{CoGAPS Matrix Factorization Algorithm} |
6 | 6 |
\usage{ |
7 | 7 |
CoGAPS(D, S, nFactor = 7, nEquil = 250, nSample = 250, nOutputs = 1000, |
8 |
+<<<<<<< HEAD |
|
8 | 9 |
nSnapshots = 0, alphaA = 0.01, alphaP = 0.01, maxGibbmassA = 100, |
9 | 10 |
maxGibbmassP = 100, seed = NA, messages = TRUE, |
10 | 11 |
singleCellRNASeq = FALSE, whichMatrixFixed = "N", |
11 | 12 |
fixedPatterns = matrix(0), checkpointInterval = 0, |
12 | 13 |
checkpointFile = "gaps_checkpoint.out", nCores = 1, ...) |
14 |
+======= |
|
15 |
+ alphaA = 0.01, alphaP = 0.01, maxGibbmassA = 100, maxGibbmassP = 100, |
|
16 |
+ seed = -1, messages = TRUE, singleCellRNASeq = FALSE, |
|
17 |
+ whichMatrixFixed = "N", fixedPatterns = matrix(0), |
|
18 |
+ checkpointInterval = 0, checkpointFile = "gaps_checkpoint.out", |
|
19 |
+ nCores = 1, ...) |
|
20 |
+>>>>>>> develop |
|
13 | 21 |
} |
14 | 22 |
\arguments{ |
15 | 23 |
\item{D}{data matrix} |
... | ... |
@@ -25,8 +33,6 @@ greater than or equal to the number of rows of FP} |
25 | 33 |
|
26 | 34 |
\item{nOutputs}{how often to print status into R by iterations} |
27 | 35 |
|
28 |
-\item{nSnapshots}{the number of individual samples to capture} |
|
29 |
- |
|
30 | 36 |
\item{alphaA}{sparsity parameter for A domain} |
31 | 37 |
|
32 | 38 |
\item{alphaP}{sparsity parameter for P domain} |
... | ... |
@@ -4,16 +4,20 @@ |
4 | 4 |
\alias{CoGapsFromCheckpoint} |
5 | 5 |
\title{Restart CoGAPS from Checkpoint File} |
6 | 6 |
\usage{ |
7 |
-CoGapsFromCheckpoint(D, S, path, checkpointFile = NA) |
|
7 |
+CoGapsFromCheckpoint(D, S, nFactor, nIter, checkpointFile) |
|
8 | 8 |
} |
9 | 9 |
\arguments{ |
10 | 10 |
\item{D}{data matrix} |
11 | 11 |
|
12 | 12 |
\item{S}{uncertainty matrix} |
13 | 13 |
|
14 |
-\item{path}{path to checkpoint file} |
|
14 |
+\item{nFactor}{number of patterns} |
|
15 |
+ |
|
16 |
+\item{nIter}{number of iterations} |
|
15 | 17 |
|
16 |
-\item{checkpointFile}{name for future checkpooints made} |
|
18 |
+\item{checkpointFile}{path to checkpoint file} |
|
19 |
+ |
|
20 |
+\item{path}{path to checkpoint file} |
|
17 | 21 |
} |
18 | 22 |
\value{ |
19 | 23 |
list with A and P matrix estimates |
... | ... |
@@ -3,6 +3,8 @@ |
3 | 3 |
|
4 | 4 |
#include <fstream> |
5 | 5 |
|
6 |
+#include <boost/random/mersenne_twister.hpp> |
|
7 |
+ |
|
6 | 8 |
// flags for opening an archive |
7 | 9 |
#define ARCHIVE_READ std::ios::in |
8 | 10 |
#define ARCHIVE_WRITE (std::ios::out | std::ios::trunc) |
... | ... |
@@ -39,6 +41,48 @@ public: |
39 | 41 |
|
40 | 42 |
void close() {mStream.close();} |
41 | 43 |
|
44 |
+ template<typename T> |
|
45 |
+ friend Archive& writeToArchive(Archive &ar, T val) |
|
46 |
+ { |
|
47 |
+ ar.mStream.write(reinterpret_cast<char*>(&val), sizeof(T)); // NOLINT |
|
48 |
+ return ar; |
|
49 |
+ } |
|
50 |
+ |
|
51 |
+ template<typename T> |
|
52 |
+ friend Archive& readFromArchive(Archive &ar, T &val) |
|
53 |
+ { |
|
54 |
+ ar.mStream.read(reinterpret_cast<char*>(&val), sizeof(T)); // NOLINT |
|
55 |
+ return ar; |
|
56 |
+ } |
|
57 |
+ |
|
58 |
+ // explicitly define which types can be automatically written/read |
|
59 |
+ // don't have C++11 and don't want to add another dependency on boost, |
|
60 |
+ // so no template tricks |
|
61 |
+ |
|
62 |
+ friend Archive& operator<<(Archive &ar, bool val) { return writeToArchive(ar, val); } |
|
63 |
+ friend Archive& operator<<(Archive &ar, int val) { return writeToArchive(ar, val); } |
|
64 |
+ friend Archive& operator<<(Archive &ar, unsigned val) { return writeToArchive(ar, val); } |
|
65 |
+ friend Archive& operator<<(Archive &ar, uint64_t val) { return writeToArchive(ar, val); } |
|
66 |
+ friend Archive& operator<<(Archive &ar, int64_t val) { return writeToArchive(ar, val); } |
|
67 |
+ friend Archive& operator<<(Archive &ar, float val) { return writeToArchive(ar, val); } |
|
68 |
+ friend Archive& operator<<(Archive &ar, double val) { return writeToArchive(ar, val); } |
|
69 |
+ friend Archive& operator<<(Archive &ar, boost::random::mt11213b val) { return writeToArchive(ar, val); } |
|
70 |
+ |
|
71 |
+ friend Archive& operator>>(Archive &ar, bool &val) { return readFromArchive(ar, val); } |
|
72 |
+ friend Archive& operator>>(Archive &ar, int &val) { return readFromArchive(ar, val); } |
|
73 |
+ friend Archive& operator>>(Archive &ar, unsigned &val) { return readFromArchive(ar, val); } |
|
74 |
+ friend Archive& operator>>(Archive &ar, uint64_t &val) { return readFromArchive(ar, val); } |
|
75 |
+ friend Archive& operator>>(Archive &ar, int64_t &val) { return readFromArchive(ar, val); } |
|
76 |
+ friend Archive& operator>>(Archive &ar, float &val) { return readFromArchive(ar, val); } |
|
77 |
+ friend Archive& operator>>(Archive &ar, double &val) { return readFromArchive(ar, val); } |
|
78 |
+ friend Archive& operator>>(Archive &ar, boost::random::mt11213b &val) { return readFromArchive(ar, val); } |
|
79 |
+ |
|
80 |
+/* |
|
81 |
+ friend Archive& operator>>(Archive &ar, uint64_t &val) |
|
82 |
+ { |
|
83 |
+ return readPrimitiveFromArchive(ar, val); |
|
84 |
+ } |
|
85 |
+ |
|
42 | 86 |
template<typename T> |
43 | 87 |
friend Archive& operator<<(Archive &ar, T val) |
44 | 88 |
{ |
... | ... |
@@ -46,12 +90,14 @@ public: |
46 | 90 |
return ar; |
47 | 91 |
} |
48 | 92 |
|
93 |
+ |
|
49 | 94 |
template<typename T> |
50 | 95 |
friend Archive& operator>>(Archive &ar, T &val) |
51 | 96 |
{ |
52 | 97 |
ar.mStream.read(reinterpret_cast<char*>(&val), sizeof(T)); // NOLINT |
53 | 98 |
return ar; |
54 | 99 |
} |
100 |
+*/ |
|
55 | 101 |
}; |
56 | 102 |
|
57 | 103 |
#endif |
... | ... |
@@ -43,8 +43,8 @@ public: |
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
// serialization |
46 |
- friend Archive& operator<<(Archive &ar, Atom &domain); |
|
47 |
- friend Archive& operator>>(Archive &ar, Atom &domain); |
|
46 |
+ friend Archive& operator<<(Archive &ar, Atom &a); |
|
47 |
+ friend Archive& operator>>(Archive &ar, Atom &a); |
|
48 | 48 |
}; |
49 | 49 |
|
50 | 50 |
struct RawAtom |
... | ... |
@@ -85,7 +85,7 @@ bool singleCellRNASeq, unsigned nCores) |
85 | 85 |
/* |
86 | 86 |
Rcpp::List cogapsFromCheckpoint_cpp(const Rcpp::NumericMatrix &D, |
87 | 87 |
const Rcpp::NumericMatrix &S, unsigned nFactor, unsigned nEquil, |
88 |
-unsigned nSample, const std::string &fileName, const std::string &cptFile) |
|
88 |
+unsigned nSample, const std::string &cptFile) |
|
89 | 89 |
{ |
90 | 90 |
GapsRunner runner(D, S, nFactor, nEquil, nSample, cptFile); |
91 | 91 |
return runner.run(); |
... | ... |
@@ -19,6 +19,15 @@ mPSampler(data, data.pmax(0.1f), nPatterns, alphaP, maxGibbsMassP), |
19 | 19 |
mStatistics(data.nRow(), data.nCol(), nPatterns), |
20 | 20 |
mSamplePhase(false), mNumUpdatesA(0), mNumUpdatesP(0) |
21 | 21 |
{ |
22 |
+ if (mFixedMatrix == 'A') |
|
23 |
+ { |
|
24 |
+ mASampler.setMatrix(ColMatrix(FP)); |
|
25 |
+ } |
|
26 |
+ else if (mFixedMatrix == 'P') |
|
27 |
+ { |
|
28 |
+ mPSampler.setMatrix(RowMatrix(FP)); |
|
29 |
+ } |
|
30 |
+ |
|
22 | 31 |
mASampler.sync(mPSampler); |
23 | 32 |
mPSampler.sync(mASampler); |
24 | 33 |
} |
... | ... |
@@ -100,4 +109,4 @@ void GapsRunner::setUncertainty(const RowMatrix &S) |
100 | 109 |
{ |
101 | 110 |
mASampler.setUncertainty(S); |
102 | 111 |
mPSampler.setUncertainty(S); |
103 |
-} |
|
104 | 112 |
\ No newline at end of file |
113 |
+} |
... | ... |
@@ -1,11 +1,11 @@ |
1 | 1 |
#include "GapsStatistics.h" |
2 | 2 |
#include "math/Algorithms.h" |
3 | 3 |
|
4 |
-GapsStatistics::GapsStatistics(unsigned nRow, unsigned nCol, unsigned nFactor) |
|
4 |
+GapsStatistics::GapsStatistics(unsigned nRow, unsigned nCol, unsigned nFactor, PumpThreshold t) |
|
5 | 5 |
: mAMeanMatrix(nRow, nFactor), mAStdMatrix(nRow, nFactor), |
6 | 6 |
mPMeanMatrix(nFactor, nCol), mPStdMatrix(nFactor, nCol), |
7 | 7 |
mStatUpdates(0), mNumPatterns(nFactor), mPumpMatrix(nRow, nCol), |
8 |
- mPumpThreshold(PUMP_CUT), mPumpStatUpdates(0) |
|
8 |
+ mPumpThreshold(t), mPumpStatUpdates(0) |
|
9 | 9 |
{} |
10 | 10 |
|
11 | 11 |
void GapsStatistics::update(const AmplitudeGibbsSampler &ASampler, |
... | ... |
@@ -45,15 +45,9 @@ static unsigned geneThreshold(const ColMatrix &rankMatrix, unsigned pat) |
45 | 45 |
return static_cast<unsigned>(cutRank); |
46 | 46 |
} |
47 | 47 |
|
48 |
-void GapsStatistics::updatePump(const AmplitudeGibbsSampler &ASampler, |
|
49 |
-const PatternGibbsSampler &PSampler) |
|
48 |
+void GapsStatistics::patternMarkers(ColMatrix normedA, RowMatrix normedP, |
|
49 |
+ColMatrix &statMatrix) |
|
50 | 50 |
{ |
51 |
- mPumpStatUpdates++; |
|
52 |
- |
|
53 |
- // copy matrices so we can modify locally |
|
54 |
- ColMatrix normedA(ASampler.mMatrix); |
|
55 |
- RowMatrix normedP(PSampler.mMatrix); |
|
56 |
- |
|
57 | 51 |
// helpful notation |
58 | 52 |
unsigned nGenes = normedA.nRow(); |
59 | 53 |
unsigned nPatterns = normedA.nCol(); |
... | ... |
@@ -101,7 +95,7 @@ const PatternGibbsSampler &PSampler) |
101 | 95 |
for (unsigned i = 0; i < nGenes; ++i) |
102 | 96 |
{ |
103 | 97 |
unsigned minNdx = gaps::algo::whichMin(rsStat.getRow(i)); |
104 |
- mPumpMatrix(i,minNdx)++; |
|
98 |
+ statMatrix(i,minNdx)++; |
|
105 | 99 |
} |
106 | 100 |
} |
107 | 101 |
else if (mPumpThreshold == PUMP_CUT) |
... | ... |
@@ -119,13 +113,20 @@ const PatternGibbsSampler &PSampler) |
119 | 113 |
{ |
120 | 114 |
if (rankMatrix(i,j) <= cutRank) |
121 | 115 |
{ |
122 |
- mPumpMatrix(i,j)++; |
|
116 |
+ statMatrix(i,j)++; |
|
123 | 117 |
} |
124 | 118 |
} |
125 | 119 |
} |
126 | 120 |
} |
127 | 121 |
} |
128 | 122 |
|
123 |
+void GapsStatistics::updatePump(const AmplitudeGibbsSampler &ASampler, |
|
124 |
+const PatternGibbsSampler &PSampler) |
|
125 |
+{ |
|
126 |
+ mPumpStatUpdates++; |
|
127 |
+ patternMarkers(ASampler.mMatrix, PSampler.mMatrix, mPumpMatrix); |
|
128 |
+} |
|
129 |
+ |
|
129 | 130 |
ColMatrix GapsStatistics::AMean() const |
130 | 131 |
{ |
131 | 132 |
return mAMeanMatrix / mStatUpdates; |
... | ... |
@@ -157,6 +158,21 @@ float GapsStatistics::meanChiSq(const AmplitudeGibbsSampler &ASampler) const |
157 | 158 |
M); |
158 | 159 |
} |
159 | 160 |
|
161 |
+Rcpp::NumericMatrix GapsStatistics::pumpMatrix() const |
|
162 |
+{ |
|
163 |
+ unsigned denom = mPumpStatUpdates != 0 ? mPumpStatUpdates : 1.f; |
|
164 |
+ return (mPumpMatrix / denom).rMatrix(); |
|
165 |
+} |
|
166 |
+ |
|
167 |
+Rcpp::NumericMatrix GapsStatistics::meanPattern() |
|
168 |
+{ |
|
169 |
+ ColMatrix Amean(mAMeanMatrix / static_cast<float>(mStatUpdates)); |
|
170 |
+ RowMatrix Pmean(mPMeanMatrix / static_cast<float>(mStatUpdates)); |
|
171 |
+ ColMatrix mat(mAMeanMatrix.nRow(), mAMeanMatrix.nCol()); |
|
172 |
+ patternMarkers(Amean, Pmean, mat); |
|
173 |
+ return mat.rMatrix(); |
|
174 |
+} |
|
175 |
+ |
|
160 | 176 |
Archive& operator<<(Archive &ar, GapsStatistics &stat) |
161 | 177 |
{ |
162 | 178 |
ar << stat.mAMeanMatrix << stat.mAStdMatrix << stat.mPMeanMatrix |
... | ... |
@@ -28,7 +28,7 @@ private: |
28 | 28 |
|
29 | 29 |
public: |
30 | 30 |
|
31 |
- GapsStatistics(unsigned nRow, unsigned nCol, unsigned nFactor); |
|
31 |
+ GapsStatistics(unsigned nRow, unsigned nCol, unsigned nFactor, PumpThreshold t=PUMP_CUT); |
|
32 | 32 |
|
33 | 33 |
ColMatrix AMean() const; |
34 | 34 |
RowMatrix PMean() const; |
... | ... |
@@ -43,6 +43,8 @@ public: |
43 | 43 |
void updatePump(const AmplitudeGibbsSampler &ASampler, |
44 | 44 |
const PatternGibbsSampler &PSampler); |
45 | 45 |
|
46 |
+ void patternMarkers(ColMatrix normedA, RowMatrix normedP, ColMatrix &statMatrix); |
|
47 |
+ |
|
46 | 48 |
// serialization |
47 | 49 |
friend Archive& operator<<(Archive &ar, GapsStatistics &stat); |
48 | 50 |
friend Archive& operator>>(Archive &ar, GapsStatistics &stat); |
... | ... |
@@ -5,9 +5,6 @@ AmplitudeGibbsSampler::AmplitudeGibbsSampler(const RowMatrix &D, |
5 | 5 |
const RowMatrix &S, unsigned nFactor, float alpha, float maxGibbsMass) |
6 | 6 |
: GibbsSampler(D, S, D.nRow(), nFactor, alpha) |
7 | 7 |
{ |
8 |
- float meanD = gaps::algo::mean(mDMatrix); |
|
9 |
- mLambda = alpha * std::sqrt(nFactor / meanD); |
|
10 |
- mMaxGibbsMass = maxGibbsMass / mLambda; |
|
11 | 8 |
mQueue.setDimensionSize(mBinSize, mNumCols); |
12 | 9 |
} |
13 | 10 |
|
... | ... |
@@ -102,9 +99,6 @@ PatternGibbsSampler::PatternGibbsSampler(const RowMatrix &D, |
102 | 99 |
const RowMatrix &S, unsigned nFactor, float alpha, float maxGibbsMass) |
103 | 100 |
: GibbsSampler(D, S, nFactor, D.nCol(), alpha) |
104 | 101 |
{ |
105 |
- float meanD = gaps::algo::mean(mDMatrix); |
|
106 |
- mLambda = alpha * std::sqrt(nFactor / meanD); |
|
107 |
- mMaxGibbsMass = maxGibbsMass / mLambda; |
|
108 | 102 |
mQueue.setDimensionSize(mBinSize , mNumRows); |
109 | 103 |
} |
110 | 104 |
|
... | ... |
@@ -18,6 +18,15 @@ class GapsStatistics; |
18 | 18 |
|
19 | 19 |
/************************** GIBBS SAMPLER INTERFACE **************************/ |
20 | 20 |
|
21 |
+template <class T, class MatA, class MatB> |
|
22 |
+class GibbsSampler; |
|
23 |
+ |
|
24 |
+template <class T, class MatA, class MatB> |
|
25 |
+Archive& operator<<(Archive &ar, GibbsSampler<T, MatA, MatB> &samp); |
|
26 |
+ |
|
27 |
+template <class T, class MatA, class MatB> |
|
28 |
+Archive& operator>>(Archive &ar, GibbsSampler<T, MatA, MatB> &samp); |
|
29 |
+ |
|
21 | 30 |
template <class T, class MatA, class MatB> |
22 | 31 |
class GibbsSampler |
23 | 32 |
{ |
... | ... |
@@ -99,11 +108,11 @@ public: |
99 | 108 |
uint64_t nAtoms() const; |
100 | 109 |
|
101 | 110 |
void setUncertainty(const RowMatrix &S) { mSMatrix = MatB(S); } |
111 |
+ void setUncertainty(const std::string &path) { mSMatrix = MatB(path); } |
|
102 | 112 |
|
103 |
- void setUncertainty(FileParser &p) |
|
104 |
- { |
|
105 |
- mSMatrix = MatB(p); |
|
106 |
- } |
|
113 |
+ // serialization |
|
114 |
+ friend Archive& operator<< <T, MatA, MatB> (Archive &ar, GibbsSampler &samp); |
|
115 |
+ friend Archive& operator>> <T, MatA, MatB> (Archive &ar, GibbsSampler &samp); |
|
107 | 116 |
}; |
108 | 117 |
|
109 | 118 |
class AmplitudeGibbsSampler : public GibbsSampler<AmplitudeGibbsSampler, ColMatrix, RowMatrix> |
... | ... |
@@ -203,6 +212,11 @@ mAvgQueue(0.f), mNumQueues(0.f) |
203 | 212 |
% static_cast<uint64_t>(mNumRows * mNumCols); |
204 | 213 |
mQueue.setDomainSize(std::numeric_limits<uint64_t>::max() - remain); |
205 | 214 |
mDomain.setDomainSize(std::numeric_limits<uint64_t>::max() - remain); |
215 |
+ |
|
216 |
+ float meanD = singleCell ? gaps::algo::nonZeroMean(mDMatrix) : |
|
217 |
+ gaps::algo::mean(mDMatrix); |
|
218 |
+ mLambda = alpha * std::sqrt(nFactor / meanD); |
|
219 |
+ mMaxGibbsMass = maxGibbsMass / mLambda; |
|
206 | 220 |
} |
207 | 221 |
|
208 | 222 |
template <class T, class MatA, class MatB> |
... | ... |
@@ -503,4 +517,28 @@ uint64_t GibbsSampler<T, MatA, MatB>::nAtoms() const |
503 | 517 |
return mDomain.size(); |
504 | 518 |
} |
505 | 519 |
|
520 |
+template <class T, class MatA, class MatB> |
|
521 |
+void GibbsSampler<T, MatA, MatB>::setMatrix(const MatA &mat) |
|
522 |
+{ |
|
523 |
+ mMatrix = mat; |
|
524 |
+} |
|
525 |
+ |
|
526 |
+template <class T, class MatA, class MatB> |
|
527 |
+Archive& operator<<(Archive &ar, GibbsSampler<T, MatA, MatB> &samp) |
|
528 |
+{ |
|
529 |
+ ar << samp.mMatrix << samp.mAPMatrix << samp.mQueue << samp.mDomain << samp.mLambda << samp.mMaxGibbsMass |
|
530 |
+ << samp.mAnnealingTemp << samp.mNumRows << samp.mNumCols << samp.mBinSize << samp.mAvgQueue |
|
531 |
+ << samp.mNumQueues; |
|
532 |
+ return ar; |
|
533 |
+} |
|
534 |
+ |
|
535 |
+template <class T, class MatA, class MatB> |
|
536 |
+Archive& operator>>(Archive &ar, GibbsSampler<T, MatA, MatB> &samp) |
|
537 |
+{ |
|
538 |
+ ar >> samp.mMatrix >> samp.mAPMatrix >> samp.mQueue >> samp.mDomain >> samp.mLambda >> samp.mMaxGibbsMass |
|
539 |
+ >> samp.mAnnealingTemp >> samp.mNumRows >> samp.mNumCols >> samp.mBinSize >> samp.mAvgQueue |
|
540 |
+ >> samp.mNumQueues; |
|
541 |
+ return ar; |
|
542 |
+} |
|
543 |
+ |
|
506 | 544 |
#endif |
... | ... |
@@ -42,6 +42,7 @@ void ProposalQueue::clear() |
42 | 42 |
mQueue.clear(); |
43 | 43 |
mUsedPositions.clear(); |
44 | 44 |
mUsedIndices.clear(); |
45 |
+ GAPS_ASSERT(mMinAtoms == mMaxAtoms); |
|
45 | 46 |
} |
46 | 47 |
|
47 | 48 |
unsigned ProposalQueue::size() const |
... | ... |
@@ -136,7 +137,6 @@ bool ProposalQueue::birth(AtomicDomain &domain) |
136 | 137 |
mUsedIndices.insert(pos / mDimensionSize); |
137 | 138 |
mUsedPositions.insert(pos); |
138 | 139 |
domain.insert(pos, 0.f); |
139 |
- ++mMinAtoms; // TODO could be rejected |
|
140 | 140 |
++mMaxAtoms; |
141 | 141 |
return true; |
142 | 142 |
} |
... | ... |
@@ -5,6 +5,7 @@ |
5 | 5 |
|
6 | 6 |
using namespace Rcpp; |
7 | 7 |
|
8 |
+<<<<<<< HEAD |
|
8 | 9 |
// cogapsFromFile_cpp |
9 | 10 |
Rcpp::List cogapsFromFile_cpp(const std::string& D, unsigned nPatterns, unsigned maxIter, unsigned outputFrequency, unsigned seed, float alphaA, float alphaP, float maxGibbsMassA, float maxGibbsMassP, bool messages, bool singleCellRNASeq); |
10 | 11 |
RcppExport SEXP _CoGAPS_cogapsFromFile_cpp(SEXP DSEXP, SEXP nPatternsSEXP, SEXP maxIterSEXP, SEXP outputFrequencySEXP, SEXP seedSEXP, SEXP alphaASEXP, SEXP alphaPSEXP, SEXP maxGibbsMassASEXP, SEXP maxGibbsMassPSEXP, SEXP messagesSEXP, SEXP singleCellRNASeqSEXP) { |
... | ... |
@@ -16,12 +17,28 @@ BEGIN_RCPP |
16 | 17 |
Rcpp::traits::input_parameter< unsigned >::type maxIter(maxIterSEXP); |
17 | 18 |
Rcpp::traits::input_parameter< unsigned >::type outputFrequency(outputFrequencySEXP); |
18 | 19 |
Rcpp::traits::input_parameter< unsigned >::type seed(seedSEXP); |
20 |
+======= |
|
21 |
+// cogaps_cpp |
|
22 |
+Rcpp::List cogaps_cpp(const Rcpp::NumericMatrix& D, const Rcpp::NumericMatrix& S, unsigned nFactor, unsigned nEquil, unsigned nEquilCool, unsigned nSample, unsigned nOutputs, float alphaA, float alphaP, float maxGibbmassA, float maxGibbmassP, unsigned seed, bool messages, bool singleCellRNASeq, char whichMatrixFixed, const Rcpp::NumericMatrix& FP, unsigned checkpointInterval, const std::string& cptFile, unsigned pumpThreshold, unsigned nPumpSamples, unsigned nCores); |
|
23 |
+RcppExport SEXP _CoGAPS_cogaps_cpp(SEXP DSEXP, SEXP SSEXP, SEXP nFactorSEXP, SEXP nEquilSEXP, SEXP nEquilCoolSEXP, SEXP nSampleSEXP, SEXP nOutputsSEXP, SEXP alphaASEXP, SEXP alphaPSEXP, SEXP maxGibbmassASEXP, SEXP maxGibbmassPSEXP, SEXP seedSEXP, SEXP messagesSEXP, SEXP singleCellRNASeqSEXP, SEXP whichMatrixFixedSEXP, SEXP FPSEXP, SEXP checkpointIntervalSEXP, SEXP cptFileSEXP, SEXP pumpThresholdSEXP, SEXP nPumpSamplesSEXP, SEXP nCoresSEXP) { |
|
24 |
+BEGIN_RCPP |
|
25 |
+ Rcpp::RObject rcpp_result_gen; |
|
26 |
+ Rcpp::RNGScope rcpp_rngScope_gen; |
|
27 |
+ Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type D(DSEXP); |
|
28 |
+ Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type S(SSEXP); |
|
29 |
+ Rcpp::traits::input_parameter< unsigned >::type nFactor(nFactorSEXP); |
|
30 |
+ Rcpp::traits::input_parameter< unsigned >::type nEquil(nEquilSEXP); |
|
31 |
+ Rcpp::traits::input_parameter< unsigned >::type nEquilCool(nEquilCoolSEXP); |
|
32 |
+ Rcpp::traits::input_parameter< unsigned >::type nSample(nSampleSEXP); |
|
33 |
+ Rcpp::traits::input_parameter< unsigned >::type nOutputs(nOutputsSEXP); |
|
34 |
+>>>>>>> develop |
|
19 | 35 |
Rcpp::traits::input_parameter< float >::type alphaA(alphaASEXP); |
20 | 36 |
Rcpp::traits::input_parameter< float >::type alphaP(alphaPSEXP); |
21 | 37 |
Rcpp::traits::input_parameter< float >::type maxGibbsMassA(maxGibbsMassASEXP); |
22 | 38 |
Rcpp::traits::input_parameter< float >::type maxGibbsMassP(maxGibbsMassPSEXP); |
23 | 39 |
Rcpp::traits::input_parameter< bool >::type messages(messagesSEXP); |
24 | 40 |
Rcpp::traits::input_parameter< bool >::type singleCellRNASeq(singleCellRNASeqSEXP); |
41 |
+<<<<<<< HEAD |
|
25 | 42 |
rcpp_result_gen = Rcpp::wrap(cogapsFromFile_cpp(D, nPatterns, maxIter, outputFrequency, seed, alphaA, alphaP, maxGibbsMassA, maxGibbsMassP, messages, singleCellRNASeq)); |
26 | 43 |
return rcpp_result_gen; |
27 | 44 |
END_RCPP |
... | ... |
@@ -29,10 +46,27 @@ END_RCPP |
29 | 46 |
// cogaps_cpp |
30 | 47 |
Rcpp::List cogaps_cpp(const Rcpp::NumericMatrix& D, unsigned nPatterns, unsigned maxIter, unsigned outputFrequency, unsigned seed, float alphaA, float alphaP, float maxGibbsMassA, float maxGibbsMassP, bool messages, bool singleCellRNASeq, unsigned nCores); |
31 | 48 |
RcppExport SEXP _CoGAPS_cogaps_cpp(SEXP DSEXP, SEXP nPatternsSEXP, SEXP maxIterSEXP, SEXP outputFrequencySEXP, SEXP seedSEXP, SEXP alphaASEXP, SEXP alphaPSEXP, SEXP maxGibbsMassASEXP, SEXP maxGibbsMassPSEXP, SEXP messagesSEXP, SEXP singleCellRNASeqSEXP, SEXP nCoresSEXP) { |
49 |
+======= |
|
50 |
+ Rcpp::traits::input_parameter< char >::type whichMatrixFixed(whichMatrixFixedSEXP); |
|
51 |
+ Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type FP(FPSEXP); |
|
52 |
+ Rcpp::traits::input_parameter< unsigned >::type checkpointInterval(checkpointIntervalSEXP); |
|
53 |
+ Rcpp::traits::input_parameter< const std::string& >::type cptFile(cptFileSEXP); |
|
54 |
+ Rcpp::traits::input_parameter< unsigned >::type pumpThreshold(pumpThresholdSEXP); |
|
55 |
+ Rcpp::traits::input_parameter< unsigned >::type nPumpSamples(nPumpSamplesSEXP); |
|
56 |
+ Rcpp::traits::input_parameter< unsigned >::type nCores(nCoresSEXP); |
|
57 |
+ rcpp_result_gen = Rcpp::wrap(cogaps_cpp(D, S, nFactor, nEquil, nEquilCool, nSample, nOutputs, alphaA, alphaP, maxGibbmassA, maxGibbmassP, seed, messages, singleCellRNASeq, whichMatrixFixed, FP, checkpointInterval, cptFile, pumpThreshold, nPumpSamples, nCores)); |
|
58 |
+ return rcpp_result_gen; |
|
59 |
+END_RCPP |
|
60 |
+} |
|
61 |
+// cogapsFromCheckpoint_cpp |
|
62 |
+Rcpp::List cogapsFromCheckpoint_cpp(const Rcpp::NumericMatrix& D, const Rcpp::NumericMatrix& S, unsigned nFactor, unsigned nEquil, unsigned nSample, const std::string& cptFile); |
|
63 |
+RcppExport SEXP _CoGAPS_cogapsFromCheckpoint_cpp(SEXP DSEXP, SEXP SSEXP, SEXP nFactorSEXP, SEXP nEquilSEXP, SEXP nSampleSEXP, SEXP cptFileSEXP) { |
|
64 |
+>>>>>>> develop |
|
32 | 65 |
BEGIN_RCPP |
33 | 66 |
Rcpp::RObject rcpp_result_gen; |
34 | 67 |
Rcpp::RNGScope rcpp_rngScope_gen; |
35 | 68 |
Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type D(DSEXP); |
69 |
+<<<<<<< HEAD |
|
36 | 70 |
Rcpp::traits::input_parameter< unsigned >::type nPatterns(nPatternsSEXP); |
37 | 71 |
Rcpp::traits::input_parameter< unsigned >::type maxIter(maxIterSEXP); |
38 | 72 |
Rcpp::traits::input_parameter< unsigned >::type outputFrequency(outputFrequencySEXP); |
... | ... |
@@ -45,6 +79,14 @@ BEGIN_RCPP |
45 | 79 |
Rcpp::traits::input_parameter< bool >::type singleCellRNASeq(singleCellRNASeqSEXP); |
46 | 80 |
Rcpp::traits::input_parameter< unsigned >::type nCores(nCoresSEXP); |
47 | 81 |
rcpp_result_gen = Rcpp::wrap(cogaps_cpp(D, nPatterns, maxIter, outputFrequency, seed, alphaA, alphaP, maxGibbsMassA, maxGibbsMassP, messages, singleCellRNASeq, nCores)); |
82 |
+======= |
|
83 |
+ Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type S(SSEXP); |
|
84 |
+ Rcpp::traits::input_parameter< unsigned >::type nFactor(nFactorSEXP); |
|
85 |
+ Rcpp::traits::input_parameter< unsigned >::type nEquil(nEquilSEXP); |
|
86 |
+ Rcpp::traits::input_parameter< unsigned >::type nSample(nSampleSEXP); |
|
87 |
+ Rcpp::traits::input_parameter< const std::string& >::type cptFile(cptFileSEXP); |
|
88 |
+ rcpp_result_gen = Rcpp::wrap(cogapsFromCheckpoint_cpp(D, S, nFactor, nEquil, nSample, cptFile)); |
|
89 |
+>>>>>>> develop |
|
48 | 90 |
return rcpp_result_gen; |
49 | 91 |
END_RCPP |
50 | 92 |
} |
... | ... |
@@ -70,8 +112,14 @@ END_RCPP |
70 | 112 |
} |
71 | 113 |
|
72 | 114 |
static const R_CallMethodDef CallEntries[] = { |
115 |
+<<<<<<< HEAD |
|
73 | 116 |
{"_CoGAPS_cogapsFromFile_cpp", (DL_FUNC) &_CoGAPS_cogapsFromFile_cpp, 11}, |
74 | 117 |
{"_CoGAPS_cogaps_cpp", (DL_FUNC) &_CoGAPS_cogaps_cpp, 12}, |
118 |
+======= |
|
119 |
+ {"_CoGAPS_cogaps_cpp", (DL_FUNC) &_CoGAPS_cogaps_cpp, 21}, |
|
120 |
+ {"_CoGAPS_cogapsFromCheckpoint_cpp", (DL_FUNC) &_CoGAPS_cogapsFromCheckpoint_cpp, 6}, |
|
121 |
+ {"_CoGAPS_cogapsFromFile_cpp", (DL_FUNC) &_CoGAPS_cogapsFromFile_cpp, 1}, |
|
122 |
+>>>>>>> develop |
|
75 | 123 |
{"_CoGAPS_getBuildReport_cpp", (DL_FUNC) &_CoGAPS_getBuildReport_cpp, 0}, |
76 | 124 |
{"_CoGAPS_run_catch_unit_tests", (DL_FUNC) &_CoGAPS_run_catch_unit_tests, 0}, |
77 | 125 |
{NULL, NULL, 0} |
... | ... |
@@ -9,14 +9,14 @@ struct MatrixElement |
9 | 9 |
unsigned dim[2]; |
10 | 10 |
float val; |
11 | 11 |
|
12 |
- MatrixElement(unsigned r, unsigned c, float v) |
|
12 |
+ MatrixElement(unsigned r, unsigned c, float v) // NOLINT |
|
13 | 13 |
: val(v) |
14 | 14 |
{ |
15 | 15 |
dim[0] = r; |
16 | 16 |
dim[1] = c; |
17 | 17 |
} |
18 | 18 |
|
19 |
- MatrixElement(unsigned r, unsigned c, const std::string &s) |
|
19 |
+ MatrixElement(unsigned r, unsigned c, const std::string &s) // NOLINT |
|
20 | 20 |
: val(0.f) |
21 | 21 |
{ |
22 | 22 |
dim[0] = r; |
... | ... |
@@ -27,17 +27,17 @@ struct MatrixElement |
27 | 27 |
|
28 | 28 |
unsigned operator[](unsigned i) |
29 | 29 |
{ |
30 |
- return dim[i]; |
|
30 |
+ return dim[i]; // NOLINT |
|
31 | 31 |
} |
32 | 32 |
|
33 | 33 |
unsigned row() const |
34 | 34 |
{ |
35 |
- return dim[0]; |
|
35 |
+ return dim[0]; // NOLINT |
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
unsigned col() const |
39 | 39 |
{ |
40 |
- return dim[1]; |
|
40 |
+ return dim[1]; // NOLINT |
|
41 | 41 |
} |
42 | 42 |
|
43 | 43 |
float value() const |
... | ... |
@@ -108,20 +108,20 @@ public: |
108 | 108 |
#if defined( __GAPS_AVX512__ ) |
109 | 109 |
float scalar() |
110 | 110 |
{ |
111 |
- float* ra = reinterpret_cast<float*>(&mData); |
|
111 |
+ float* ra = reinterpret_cast<float*>(&mData); // NOLINT |
|
112 | 112 |
return ra[0] + ra[1] + ra[2] + ra[3] + ra[4] + ra[5] + ra[6] + ra[7] + |
113 | 113 |
ra[8] + ra[9] + ra[10] + ra[11] + ra[12] + ra[13] + ra[14] + ra[15]; |
114 | 114 |
} |
115 | 115 |
#elif defined( __GAPS_AVX__ ) |
116 | 116 |
float scalar() |
117 | 117 |
{ |
118 |
- float* ra = reinterpret_cast<float*>(&mData); |
|
118 |
+ float* ra = reinterpret_cast<float*>(&mData); // NOLINT |
|
119 | 119 |
return ra[0] + ra[1] + ra[2] + ra[3] + ra[4] + ra[5] + ra[6] + ra[7]; |
120 | 120 |
} |
121 | 121 |
#elif defined( __GAPS_SSE__ ) |
122 | 122 |
float scalar() |
123 | 123 |
{ |
124 |
- float* ra = reinterpret_cast<float*>(&mData); |
|
124 |
+ float* ra = reinterpret_cast<float*>(&mData); // NOLINT |
|
125 | 125 |
return ra[0] + ra[1] + ra[2] + ra[3]; |
126 | 126 |
} |
127 | 127 |
#else |