Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordinale Conditions separat speichern #768

Merged
merged 22 commits into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4338515
Rename arguments, class members, etc. that refer to conditions.
michael-rapp Aug 8, 2023
0aded8c
Rename values of the enum Comparator.
michael-rapp Aug 8, 2023
0bbfd67
Merge branch 'development' into store-ordinal-conditions-separately
michael-rapp Aug 8, 2023
ebc6256
Merge branch 'development' into store-ordinal-conditions-separately
michael-rapp Aug 13, 2023
a069b91
The class CompleteHead now uses a DenseVector.
michael-rapp Aug 13, 2023
e4b9b22
Export class SparseArrayVector.
michael-rapp Aug 13, 2023
0d89a5e
Do not export class SparseArrayVector.
michael-rapp Aug 13, 2023
8015c7e
The class PartialHead now uses DenseVectors.
michael-rapp Aug 13, 2023
989b4de
Add class SparseArraysVector.
michael-rapp Aug 13, 2023
01aac76
The class PartialHead now uses a SparseArraysVector.
michael-rapp Aug 13, 2023
31a21e9
Rename class member.
michael-rapp Aug 13, 2023
4ecabc4
Export class SparseArraysVector.
michael-rapp Aug 13, 2023
9d72ab3
Edit comment.
michael-rapp Aug 13, 2023
7eb66d6
The class SparseArraysVector is not final anymore.
michael-rapp Aug 13, 2023
c9f171b
Add class IConditional.
michael-rapp Aug 13, 2023
42d0e94
The class ConjunctiveBody now uses SparseArraysVectors.
michael-rapp Aug 13, 2023
0e10c4d
The class ConjunctiveBody now stores ordinal conditions separately.
michael-rapp Aug 13, 2023
7ae02fa
Consider ordinal conditions for the output of models or model charact…
michael-rapp Aug 13, 2023
c7f6e12
Add function "isOrdinal" to class IFeatureType.
michael-rapp Aug 13, 2023
2e0b505
Format code.
michael-rapp Aug 13, 2023
daa6752
Format code.
michael-rapp Aug 13, 2023
5429468
Use appropriate conditions if a feature is nominal.
michael-rapp Aug 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
The class PartialHead now uses a SparseArraysVector.
  • Loading branch information
michael-rapp committed Aug 13, 2023
commit 01aac76d4b26b0bffe12abe898f4a442b5975cfb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
#pragma once

#include "mlrl/common/data/vector_dense.hpp"
#include "mlrl/common/data/vector_sparse_arrays.hpp"
#include "mlrl/common/model/head.hpp"

/**
Expand All @@ -12,9 +12,7 @@
class MLRLCOMMON_API PartialHead final : public IHead {
private:

DenseVector<float64> scores_;

DenseVector<uint32> labelIndices_;
SparseArraysVector<float64> vector_;

public:

Expand All @@ -26,24 +24,24 @@ class MLRLCOMMON_API PartialHead final : public IHead {
/**
* An iterator that provides access to the scores that are contained by the head and allows to modify them.
*/
typedef DenseVector<float64>::iterator score_iterator;
typedef SparseArraysVector<float64>::value_iterator score_iterator;

/**
* An iterator that provides read-only access to the scores that are contained by the head.
*/
typedef DenseVector<float64>::const_iterator score_const_iterator;
typedef SparseArraysVector<float64>::value_const_iterator score_const_iterator;

/**
* An iterator that provides access to the indices, the scores that are contained by the head, correspond to and
* allows to modify them.
*/
typedef DenseVector<uint32>::iterator index_iterator;
typedef SparseArraysVector<float64>::index_iterator index_iterator;

/**
* An iterator that provides read-only access to the indices, the scores that are contained by the head,
* correspond to.
*/
typedef DenseVector<uint32>::const_iterator index_const_iterator;
typedef SparseArraysVector<float64>::index_const_iterator index_const_iterator;

/**
* Returns the number of scores that are contained by the head.
Expand Down
21 changes: 10 additions & 11 deletions cpp/subprojects/common/src/mlrl/common/model/head_partial.cpp
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
#include "mlrl/common/model/head_partial.hpp"

PartialHead::PartialHead(uint32 numElements)
: scores_(DenseVector<float64>(numElements)), labelIndices_(DenseVector<uint32>(numElements)) {}
PartialHead::PartialHead(uint32 numElements) : vector_(SparseArraysVector<float64>(numElements)) {}

uint32 PartialHead::getNumElements() const {
return scores_.getNumElements();
return vector_.getNumElements();
}

PartialHead::score_iterator PartialHead::scores_begin() {
return scores_.begin();
return vector_.values_begin();
}

PartialHead::score_iterator PartialHead::scores_end() {
return scores_.end();
return vector_.values_end();
}

PartialHead::score_const_iterator PartialHead::scores_cbegin() const {
return scores_.cbegin();
return vector_.values_cbegin();
}

PartialHead::score_const_iterator PartialHead::scores_cend() const {
return scores_.cend();
return vector_.values_cend();
}

PartialHead::index_iterator PartialHead::indices_begin() {
return labelIndices_.begin();
return vector_.indices_begin();
}

PartialHead::index_iterator PartialHead::indices_end() {
return labelIndices_.end();
return vector_.indices_end();
}

PartialHead::index_const_iterator PartialHead::indices_cbegin() const {
return labelIndices_.cbegin();
return vector_.indices_cbegin();
}

PartialHead::index_const_iterator PartialHead::indices_cend() const {
return labelIndices_.cend();
return vector_.indices_cend();
}

void PartialHead::visit(CompleteHeadVisitor completeHeadVisitor, PartialHeadVisitor partialHeadVisitor) const {
Expand Down