Skip to content

Commit

Permalink
Merge pull request #3690 from tdjogi010/clean_up_swig_interface
Browse files Browse the repository at this point in the history
Remove apply_locked* methods from SWIG interfaces #3687
  • Loading branch information
karlnapf committed Mar 15, 2017
2 parents fd67ee5 + ad06575 commit 05777e0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/shogun/machine/DirectorKernelMachine.h
Expand Up @@ -141,6 +141,7 @@ IGNORE_IN_CLASSLIST class CDirectorKernelMachine : public CKernelMachine
CKernelMachine::set_store_model_features(store_model);
}

#ifndef SWIG // SWIG should skip this part
/** Trains a locked machine on a set of indices. Error if machine is
* not locked
*
Expand All @@ -154,6 +155,7 @@ IGNORE_IN_CLASSLIST class CDirectorKernelMachine : public CKernelMachine
return CKernelMachine::train_locked(indices);
}


/** Applies a locked machine on a set of indices. Error if machine is
* not locked
*
Expand Down Expand Up @@ -188,7 +190,8 @@ IGNORE_IN_CLASSLIST class CDirectorKernelMachine : public CKernelMachine
{
return CKernelMachine::apply_locked_get_output(indices);
}

#endif // SWIG // SWIG should skip this part

/** Locks the machine on given labels and data. After this call, only
* train_locked and apply_locked may be called
*
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/machine/DirectorLinearMachine.h
Expand Up @@ -141,6 +141,7 @@ IGNORE_IN_CLASSLIST class CDirectorLinearMachine : public CLinearMachine
CLinearMachine::set_store_model_features(store_model);
}

#ifndef SWIG // SWIG should skip this part
/** Trains a locked machine on a set of indices. Error if machine is
* not locked
*
Expand Down Expand Up @@ -176,6 +177,7 @@ IGNORE_IN_CLASSLIST class CDirectorLinearMachine : public CLinearMachine
}

using CLinearMachine::apply_locked_multiclass;
#endif // SWIG // SWIG should skip this part

/** Locks the machine on given labels and data. After this call, only
* train_locked and apply_locked may be called
Expand Down
3 changes: 3 additions & 0 deletions src/shogun/machine/KernelMachine.h
Expand Up @@ -235,6 +235,7 @@ class CKernelMachine : public CMachine
*/
static void* apply_helper(void* p);

#ifndef SWIG // SWIG should skip this part
/** Trains a locked machine on a set of indices. Error if machine is
* not locked
*
Expand All @@ -249,6 +250,7 @@ class CKernelMachine : public CMachine
* @param indices index vector (of locked features) that is predicted
* @return resulting labels
*/

virtual CBinaryLabels* apply_locked_binary(SGVector<index_t> indices);

/** Applies a locked machine on a set of indices. Error if machine is
Expand All @@ -268,6 +270,7 @@ class CKernelMachine : public CMachine
*/
virtual SGVector<float64_t> apply_locked_get_output(
SGVector<index_t> indices);
#endif // SWIG // SWIG should skip this part

/** Locks the machine on given labels and data. After this call, only
* train_locked and apply_locked may be called.
Expand Down
4 changes: 4 additions & 0 deletions src/shogun/machine/Machine.h
Expand Up @@ -228,6 +228,7 @@ class CMachine : public CSGObject
*/
virtual void set_store_model_features(bool store_model);

#ifndef SWIG // SWIG should skip this part
/** Trains a locked machine on a set of indices. Error if machine is
* not locked
*
Expand All @@ -242,6 +243,7 @@ class CMachine : public CSGObject
"for %s\n", get_name());
return false;
}
#endif // SWIG // SWIG should skip this part

/** applies to one vector */
virtual float64_t apply_one(int32_t i)
Expand All @@ -250,6 +252,7 @@ class CMachine : public CSGObject
return 0.0;
}

#ifndef SWIG // SWIG should skip this part
/** Applies a locked machine on a set of indices. Error if machine is
* not locked
*
Expand All @@ -272,6 +275,7 @@ class CMachine : public CSGObject
/** applies a locked machine on a set of indices for latent problems */
virtual CLatentLabels* apply_locked_latent(
SGVector<index_t> indices);
#endif // SWIG // SWIG should skip this part

/** Locks the machine on given labels and data. After this call, only
* train_locked and apply_locked may be called
Expand Down
2 changes: 2 additions & 0 deletions src/shogun/transfer/multitask/MultitaskLinearMachine.h
Expand Up @@ -102,11 +102,13 @@ class CMultitaskLinearMachine : public CLinearMachine
/** post lock */
virtual void post_lock(CLabels* labels, CFeatures* features_);

#ifndef SWIG // SWIG should skip this part
/** train on given indices */
virtual bool train_locked(SGVector<index_t> indices);

/** applies on given indices */
virtual CBinaryLabels* apply_locked_binary(SGVector<index_t> indices);
#endif // SWIG // SWIG should skip this part

/** applies to one vector */
virtual float64_t apply_one(int32_t i);
Expand Down

0 comments on commit 05777e0

Please sign in to comment.