Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
validator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Foxido
validator
Commits
f3ea3f77
Commit
f3ea3f77
authored
8 months ago
by
Foxido
Browse files
Options
Downloads
Patches
Plain Diff
WIP: HOTFIX FIX
parent
e850aff7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
inc/state.h
+2
-1
2 additions, 1 deletion
inc/state.h
src/operators.cpp
+1
-7
1 addition, 7 deletions
src/operators.cpp
src/state.cpp
+8
-6
8 additions, 6 deletions
src/state.cpp
with
11 additions
and
14 deletions
inc/state.h
+
2
−
1
View file @
f3ea3f77
...
...
@@ -18,11 +18,12 @@ class TaskState {
bool
is_column_orig_const
(
ColumnTag
)
const
;
size_t
const_column_index
(
ColumnTag
)
const
;
size_t
const_column_count
()
const
{
return
consts_
.
size
();
}
void
update_scan_mask
(
std
::
vector
<
bool
>&
mask
,
ColumnTag
target
)
const
;
bool
is_column_valid
(
ColumnTag
tag
)
const
{
return
chm_index_by_col_
.
contains
(
tag
);
}
...
...
This diff is collapsed.
Click to expand it.
src/operators.cpp
+
1
−
7
View file @
f3ea3f77
...
...
@@ -248,13 +248,7 @@ double JoinOperator::cardinality(const TaskState &task_state) const {
void
ScanOperator
::
const_scan_mask
(
const
TaskState
&
task_state
,
std
::
vector
<
bool
>&
mask
)
{
for
(
auto
constant
:
constants_
)
{
if
(
!
task_state
.
is_column_orig_const
(
constant
))
{
/* task number should be 2, but it should be checked somewhere else */
continue
;
}
auto
const_index
=
task_state
.
const_column_index
(
constant
);
mask
[
const_index
]
=
true
;
task_state
.
update_scan_mask
(
mask
,
constant
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/state.cpp
+
8
−
6
View file @
f3ea3f77
#include
<chm.h>
#include
<config.h>
#include
<exceptions.h>
#include
<fmt/base.h>
#include
<operators.h>
#include
<state.h>
...
...
@@ -12,7 +13,6 @@
#include
<string>
#include
<unordered_map>
#include
<vector>
#include
"exceptions.h"
TaskState
TaskState
::
from_task
(
std
::
istream
&
input
)
{
std
::
string
line
;
...
...
@@ -131,12 +131,14 @@ CHM eq_classes_from_solution(const TaskState& task_state,
return
new_equiv_classes
;
}
size_t
TaskState
::
const_column_index
(
ColumnTag
target
)
const
{
void
TaskState
::
update_scan_mask
(
std
::
vector
<
bool
>&
mask
,
ColumnTag
target
)
const
{
size_t
target_eq
=
eq_classes_
.
get
(
chm_index_by_col_
.
at
(
target
));
for
(
size_t
i
=
0
;
i
<
consts_
.
size
();
++
i
)
{
if
(
consts_
[
i
]
==
target
)
{
return
i
;
size_t
const_eq
=
eq_classes_
.
get
(
chm_index_by_col_
.
at
(
consts_
[
i
]));
if
(
target_eq
==
const_eq
)
{
mask
[
i
]
=
true
;
}
}
throw
validation_err_type
::
SEARCH_CONST_NOT_CONST
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment