This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| push!(LOAD_PATH, "/Users/czhang/Desktop/Projects/dw_/julia/") | |
| import DimmWitted | |
| DimmWitted.set_libpath("/Users/czhang/Desktop/Projects/dw_/libdw_julia") | |
| ###################################### | |
| # The following function creates a | |
| # synthetic data set: | |
| # - Data type is Cdouble | |
| # - Modle type is Array{Cdouble} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| push!(LOAD_PATH, "/Users/czhang/Desktop/Projects/dw_/julia/") | |
| import DimmWitted | |
| DimmWitted.set_libpath("/Users/czhang/Desktop/Projects/dw_/libdw_julia") | |
| ###################################### | |
| # The following function creates a | |
| # synthetic data set: | |
| # - Data type is Cdouble | |
| # - Modle type is Array{Cdouble} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| push!(LOAD_PATH, "/Users/czhang/Desktop/Projects/dw_/julia/") | |
| import DimmWitted | |
| DimmWitted.set_libpath("/Users/czhang/Desktop/Projects/dw_/libdw_julia") | |
| gc_disable() | |
| ###################################### | |
| # The following function creates a | |
| # synthetic data set: | |
| # - Data type is Cdouble |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| push!(LOAD_PATH, "/Users/czhang/Desktop/Projects/dw_/julia/") | |
| import DimmWitted | |
| DimmWitted.set_libpath("/Users/czhang/Desktop/Projects/dw_/libdw_julia") | |
| ###################################### | |
| # The following function creates a | |
| # synthetic data set: | |
| # - Data type is Cdouble | |
| # - Modle type is Array{Cdouble} | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| push!(LOAD_PATH, "/Users/czhang/Desktop/Projects/dw_/julia/") | |
| import DimmWitted | |
| DimmWitted.set_libpath("/Users/czhang/Desktop/Projects/dw_/libdw_julia") | |
| ###################################### | |
| # The following piece of code creates a | |
| # synthetic data set: | |
| # - Data type is Cdouble | |
| # - Modle type is Array{Cdouble} | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bool Serialize(int fd) const { | |
| int flag = contains_value_; | |
| int pt = 0; | |
| memcpy((void*) &buf[pt], &flag, sizeof(flag)); | |
| pt += sizeof(flag); | |
| int length = key_.length(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bool Deserialize(int fd) { | |
| int flag; | |
| int length; | |
| ReadN(fd, (char*) &flag, sizeof(flag)); | |
| contains_value_ = flag; | |
| ReadN(fd, (char*) &length, sizeof(length)); | |
| ReadN(fd, (char*) buf, length); | |
| key_ = std::string(buf); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef MESSAGE_H | |
| #define MESSAGE_H | |
| #include <string> | |
| #include <iostream> | |
| #include "common.h" | |
| class Message { | |
| private: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inference.factors: { | |
| # Smokes(x) => Cancer(x) | |
| smokes_cancer { | |
| input_query: """ | |
| SELECT person_has_cancer.id as "person_has_cancer.id", | |
| person_smokes.id as "person_smokes.id", | |
| person_smokes.smokes as "person_smokes.smokes", | |
| person_has_cancer.has_cancer as "person_has_cancer.has_cancer" | |
| FROM person_has_cancer, person_smokes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <chrono> | |
| #include <ctime> | |
| using namespace std; | |
| // double n=4 << 21; | |
| long n=1E3 * 1E3 * 1E3; | |
| const long cnt=1e8; | |
| double fast(const double* const a) { |