forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ccfits.rb
52 lines (46 loc) · 1.8 KB
/
ccfits.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class Ccfits < Formula
homepage "https://heasarc.gsfc.nasa.gov/fitsio/CCfits/"
url "https://heasarc.gsfc.nasa.gov/fitsio/CCfits/CCfits-2.4.tar.gz"
sha256 "ba6c5012b260adf7633f92581279ea582e331343d8c973981aa7de07242bd7f8"
option "without-check", "Disable build-time checking (not recommended)"
depends_on "cfitsio"
# patch for OS X Mavericks build system
# see https://heasarc.gsfc.nasa.gov/fitsio/CCfits/html/
patch :DATA
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make"
system "make", "check" if build.with? "check"
system "make", "install"
end
end
__END__
--- a/ColumnVectorData.h
+++ b/ColumnVectorData.h
@@ -260,13 +260,16 @@
if ( that.m_data.size() != n ) return false;
for (size_t i = 0; i < n ; i++)
{
- size_t nn = m_data[i].size();
- // first check size (also, == on 2 valarrays is only defined if they
- // are equal in size).
- if (that.m_data[i].size() != nn ) return false;
-
- std::valarray<bool> test = (m_data[i] == that.m_data[i]);
- for (size_t j = 0; j < nn ; j++ ) if ( !test[j] ) return false;
+ const std::valarray<T>& thisValArray=m_data[i];
+ const std::valarray<T>& thatValArray=that.m_data[i];
+ size_t nn = thisValArray.size();
+ if (thatValArray.size() != nn ) return false;
+
+ for (size_t j = 0; j < nn ; j++ )
+ {
+ if (thisValArray[j] != thatValArray[j])
+ return false;
+ }
}
return true;
}