annotate carfac/carfac_output.cc @ 645:3f01a136c537

DISALLOW_COPY_AND_ASSIGN in CARFAC classes and fix a few funny indentations.
author ronw@google.com
date Tue, 11 Jun 2013 17:59:08 +0000
parents 8b70f4cf00c7
children e76951e4da20
rev   line source
alexbrandmeyer@609 1 //
alexbrandmeyer@609 2 // carfac_output.cc
alexbrandmeyer@609 3 // CARFAC Open Source C++ Library
alexbrandmeyer@609 4 //
alexbrandmeyer@609 5 // Created by Alex Brandmeyer on 5/10/13.
alexbrandmeyer@609 6 //
alexbrandmeyer@609 7 // This C++ file is part of an implementation of Lyon's cochlear model:
alexbrandmeyer@609 8 // "Cascade of Asymmetric Resonators with Fast-Acting Compression"
alexbrandmeyer@609 9 // to supplement Lyon's upcoming book "Human and Machine Hearing"
alexbrandmeyer@609 10 //
alexbrandmeyer@609 11 // Licensed under the Apache License, Version 2.0 (the "License");
alexbrandmeyer@609 12 // you may not use this file except in compliance with the License.
alexbrandmeyer@609 13 // You may obtain a copy of the License at
alexbrandmeyer@609 14 //
alexbrandmeyer@609 15 // http://www.apache.org/licenses/LICENSE-2.0
alexbrandmeyer@609 16 //
alexbrandmeyer@609 17 // Unless required by applicable law or agreed to in writing, software
alexbrandmeyer@609 18 // distributed under the License is distributed on an "AS IS" BASIS,
alexbrandmeyer@609 19 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
alexbrandmeyer@609 20 // See the License for the specific language governing permissions and
alexbrandmeyer@609 21 // limitations under the License.
alexbrandmeyer@609 22
alexbrandmeyer@609 23 #include "carfac_output.h"
alexbrandmeyer@637 24
alexbrandmeyer@636 25 using std::vector;
alexbrandmeyer@609 26
alexbrandmeyer@643 27 CARFACOutput::CARFACOutput(const bool store_nap, const bool store_nap_decim,
ronw@645 28 const bool store_bm, const bool store_ohc,
ronw@645 29 const bool store_agc) {
alexbrandmeyer@636 30 store_nap_ = store_nap;
alexbrandmeyer@636 31 store_nap_decim_ = store_nap_decim;
alexbrandmeyer@636 32 store_bm_ = store_bm;
alexbrandmeyer@636 33 store_ohc_ = store_ohc;
alexbrandmeyer@636 34 store_agc_ = store_agc;
alexbrandmeyer@636 35
alexbrandmeyer@609 36 }
alexbrandmeyer@609 37
ronw@645 38 void CARFACOutput::AppendOutput(const vector<Ear*>& ears) {
alexbrandmeyer@636 39 if (store_nap_) {
alexbrandmeyer@643 40 nap_.push_back(vector<ArrayX>());
ronw@645 41 for (const auto& ear : ears) {
ronw@645 42 nap_.back().push_back(ear->ihc_out());
alexbrandmeyer@636 43 }
alexbrandmeyer@636 44 }
alexbrandmeyer@636 45 if (store_ohc_) {
alexbrandmeyer@643 46 ohc_.push_back(vector<ArrayX>());
ronw@645 47 for (const auto& ear : ears) {
ronw@645 48 ohc_.back().push_back(ear->za_memory());
alexbrandmeyer@636 49 }
alexbrandmeyer@636 50 }
alexbrandmeyer@636 51 if (store_agc_) {
alexbrandmeyer@643 52 agc_.push_back(vector<ArrayX>());
ronw@645 53 for (const auto& ear : ears) {
ronw@645 54 agc_.back().push_back(ear->zb_memory());
alexbrandmeyer@636 55 }
alexbrandmeyer@636 56 }
alexbrandmeyer@636 57 if (store_bm_) {
alexbrandmeyer@643 58 bm_.push_back(vector<ArrayX>());
ronw@645 59 for (const auto& ear : ears) {
ronw@645 60 bm_.back().push_back(ear->zy_memory());
alexbrandmeyer@636 61 }
alexbrandmeyer@636 62 }
ronw@645 63 }