LCOV - code coverage report
Current view: top level - src - gensvm_copy.c (source / functions) Hit Total Coverage
Test: coverage.all Lines: 12 12 100.0 %
Date: 2017-02-21 18:44:20 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /**
       2             :  * @file gensvm_copy.c
       3             :  * @author G.J.J. van den Burg
       4             :  * @date 2016-05-01
       5             :  * @brief Function for copying a GenModel instance
       6             :  *
       7             :  * @copyright
       8             :  Copyright 2016, G.J.J. van den Burg.
       9             : 
      10             :  This file is part of GenSVM.
      11             : 
      12             :  GenSVM is free software: you can redistribute it and/or modify
      13             :  it under the terms of the GNU General Public License as published by
      14             :  the Free Software Foundation, either version 3 of the License, or
      15             :  (at your option) any later version.
      16             : 
      17             :  GenSVM is distributed in the hope that it will be useful,
      18             :  but WITHOUT ANY WARRANTY; without even the implied warranty of
      19             :  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      20             :  GNU General Public License for more details.
      21             : 
      22             :  You should have received a copy of the GNU General Public License
      23             :  along with GenSVM. If not, see <http://www.gnu.org/licenses/>.
      24             : 
      25             :  */
      26             : 
      27             : #include "gensvm_copy.h"
      28             : 
      29             : /**
      30             :  * @brief Copy model parameters between two GenModel structs
      31             :  *
      32             :  * @details
      33             :  * The parameters copied are:
      34             :  *  - GenModel::weight_idx
      35             :  *  - GenModel::epsilon
      36             :  *  - GenModel::p
      37             :  *  - GenModel::kappa
      38             :  *  - GenModel::lambda
      39             :  *  - GenModel::kerneltype
      40             :  *  - GenModel::gamma
      41             :  *  - GenModel::coef
      42             :  *  - GenModel::degree
      43             :  *  - GenModel::max_iter
      44             :  *
      45             :  * @param[in]           from    GenModel to copy parameters from
      46             :  * @param[in,out]       to      GenModel to copy parameters to
      47             :  */
      48           7 : void gensvm_copy_model(struct GenModel *from, struct GenModel *to)
      49             : {
      50           7 :         to->weight_idx = from->weight_idx;
      51           7 :         to->epsilon = from->epsilon;
      52           7 :         to->p = from->p;
      53           7 :         to->kappa = from->kappa;
      54           7 :         to->lambda = from->lambda;
      55             : 
      56           7 :         to->kerneltype = from->kerneltype;
      57           7 :         to->gamma = from->gamma;
      58           7 :         to->coef = from->coef;
      59           7 :         to->degree = from->degree;
      60             : 
      61           7 :         to->max_iter = from->max_iter;
      62           7 : }

Generated by: LCOV version 1.12