diff options
author | Mike Buland <mike@xagasoft.com> | 2012-07-09 15:34:11 -0600 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2012-07-09 15:34:11 -0600 |
commit | a48556c1c5c01892cf493cd3eb4ff969a2f548fd (patch) | |
tree | afd36d14133069fed0fcfccefb827c92da51496c /src/phenotypebinary.cpp | |
parent | d9dc8bda6278cc1f64b3656336d3f01472458303 (diff) | |
download | libgenetic-a48556c1c5c01892cf493cd3eb4ff969a2f548fd.tar.gz libgenetic-a48556c1c5c01892cf493cd3eb4ff969a2f548fd.tar.bz2 libgenetic-a48556c1c5c01892cf493cd3eb4ff969a2f548fd.tar.xz libgenetic-a48556c1c5c01892cf493cd3eb4ff969a2f548fd.zip |
Simple saving/loading - consider this temporary.
It should be a little more compact, and have more header info so we can
reconstruct the entire object from the file, right now you have to know
the size in bits.
Diffstat (limited to 'src/phenotypebinary.cpp')
-rw-r--r-- | src/phenotypebinary.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/phenotypebinary.cpp b/src/phenotypebinary.cpp index 68f9ebf..0d32c9f 100644 --- a/src/phenotypebinary.cpp +++ b/src/phenotypebinary.cpp | |||
@@ -133,3 +133,13 @@ void Genetic::PhenotypeBinary::extractBits( uint64_t &rTarget, int iStart, | |||
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | void Genetic::PhenotypeBinary::write( Bu::Stream &rStream ) | ||
137 | { | ||
138 | rStream.write( aGenes, sizeof(uint_fast32_t)*iWords ); | ||
139 | } | ||
140 | |||
141 | void Genetic::PhenotypeBinary::read( Bu::Stream &rStream ) | ||
142 | { | ||
143 | rStream.read( aGenes, sizeof(uint_fast32_t)*iWords ); | ||
144 | } | ||
145 | |||