| 119 | } |
| 120 | |
| 121 | CompoundDataPtr interpolateCompoundData( const CompoundData *y0, const CompoundData *y1, double x ) |
| 122 | { |
| 123 | CompoundDataPtr result = y0->copy(); |
| 124 | CompoundDataMap &resultWritable = result->writable(); |
| 125 | const CompoundDataMap y1Readable = y1->readable(); |
| 126 | for( const auto &member : y0->readable() ) |
| 127 | { |
| 128 | CompoundDataMap::const_iterator it = y1Readable.find( member.first ); |
| 129 | if( it != y1Readable.end() && it->second->typeId() == member.second->typeId() ) |
| 130 | { |
| 131 | DataPtr interpolatedMember = boost::static_pointer_cast<Data>( |
| 132 | linearObjectInterpolation( member.second.get(), it->second.get(), x ) |
| 133 | ); |
| 134 | if( interpolatedMember ) |
| 135 | { |
| 136 | resultWritable[member.first] = interpolatedMember; |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | return result; |
| 141 | } |
| 142 | |
| 143 | CompoundObjectPtr interpolateCompoundObject( const CompoundObject *y0, const CompoundObject *y1, double x ) |
| 144 | { |