Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Root
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
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
Admin message
为了安全,强烈建议开启2FA双因子认证:User Settings -> Account -> Enable two-factor authentication!!!
Show more breadcrumbs
cxwx
Root
Commits
f736df07
Commit
f736df07
authored
5 years ago
by
Jakob Blomer
Committed by
Axel Naumann
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[forest] add support for std::int32_t
parent
49d6c56e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tree/forest/v7/inc/ROOT/RColumnElement.hxx
+9
-0
9 additions, 0 deletions
tree/forest/v7/inc/ROOT/RColumnElement.hxx
tree/forest/v7/inc/ROOT/RField.hxx
+39
-0
39 additions, 0 deletions
tree/forest/v7/inc/ROOT/RField.hxx
tree/forest/v7/src/RField.cxx
+12
-0
12 additions, 0 deletions
tree/forest/v7/src/RField.cxx
with
60 additions
and
0 deletions
tree/forest/v7/inc/ROOT/RColumnElement.hxx
+
9
−
0
View file @
f736df07
...
...
@@ -133,6 +133,15 @@ public:
explicit
RColumnElement
(
double
*
value
)
:
RColumnElementBase
(
value
,
kSize
,
kIsMappable
)
{}
};
template
<
>
class
ROOT
::
Experimental
::
Detail
::
RColumnElement
<
std
::
int32_t
,
ROOT
::
Experimental
::
EColumnType
::
kInt32
>
:
public
ROOT
::
Experimental
::
Detail
::
RColumnElementBase
{
public:
static
constexpr
bool
kIsMappable
=
true
;
static
constexpr
size_t
kSize
=
sizeof
(
std
::
int32_t
);
explicit
RColumnElement
(
std
::
int32_t
*
value
)
:
RColumnElementBase
(
value
,
kSize
,
kIsMappable
)
{}
};
template
<
>
class
ROOT
::
Experimental
::
Detail
::
RColumnElement
<
std
::
uint32_t
,
ROOT
::
Experimental
::
EColumnType
::
kInt32
>
:
public
ROOT
::
Experimental
::
Detail
::
RColumnElementBase
{
...
...
This diff is collapsed.
Click to expand it.
tree/forest/v7/inc/ROOT/RField.hxx
+
39
−
0
View file @
f736df07
...
...
@@ -471,6 +471,45 @@ public:
size_t
GetValueSize
()
const
final
{
return
sizeof
(
double
);
}
};
template
<
>
class
ROOT
::
Experimental
::
RField
<
std
::
int32_t
>
:
public
ROOT
::
Experimental
::
Detail
::
RFieldBase
{
public:
static
std
::
string
MyTypeName
()
{
return
"std::int32_t"
;
}
explicit
RField
(
std
::
string_view
name
)
:
Detail
::
RFieldBase
(
name
,
MyTypeName
(),
EForestStructure
::
kLeaf
,
true
/* isSimple */
)
{}
RField
(
RField
&&
other
)
=
default
;
RField
&
operator
=
(
RField
&&
other
)
=
default
;
~
RField
()
=
default
;
RFieldBase
*
Clone
(
std
::
string_view
newName
)
final
{
return
new
RField
(
newName
);
}
void
DoGenerateColumns
()
final
;
unsigned
int
GetNColumns
()
const
final
{
return
1
;
}
std
::
int32_t
*
Map
(
ForestSize_t
index
)
{
static_assert
(
Detail
::
RColumnElement
<
std
::
int32_t
,
EColumnType
::
kInt32
>::
kIsMappable
,
"(std::int32_t, EColumnType::kInt32) is not identical on this platform"
);
return
fPrincipalColumn
->
Map
<
std
::
int32_t
,
EColumnType
::
kInt32
>
(
index
,
nullptr
);
}
using
Detail
::
RFieldBase
::
GenerateValue
;
template
<
typename
...
ArgsT
>
ROOT
::
Experimental
::
Detail
::
RFieldValueBase
GenerateValue
(
void
*
where
,
ArgsT
&&
...
args
)
{
ROOT
::
Experimental
::
RFieldValue
<
std
::
int32_t
>
v
(
Detail
::
RColumnElement
<
std
::
int32_t
,
EColumnType
::
kInt32
>
(
static_cast
<
std
::
int32_t
*>
(
where
)),
this
,
static_cast
<
std
::
int32_t
*>
(
where
),
std
::
forward
<
ArgsT
>
(
args
)...);
return
v
;
}
ROOT
::
Experimental
::
Detail
::
RFieldValueBase
GenerateValue
(
void
*
where
)
final
{
return
GenerateValue
(
where
,
0
);
}
Detail
::
RFieldValueBase
CaptureValue
(
void
*
where
)
final
{
ROOT
::
Experimental
::
RFieldValue
<
std
::
int32_t
>
v
(
true
,
Detail
::
RColumnElement
<
std
::
int32_t
,
EColumnType
::
kInt32
>
(
static_cast
<
std
::
int32_t
*>
(
where
)),
this
,
static_cast
<
std
::
int32_t
*>
(
where
));
return
v
;
}
size_t
GetValueSize
()
const
final
{
return
sizeof
(
std
::
int32_t
);
}
};
template
<
>
class
ROOT
::
Experimental
::
RField
<
std
::
uint32_t
>
:
public
ROOT
::
Experimental
::
Detail
::
RFieldBase
{
public:
...
...
This diff is collapsed.
Click to expand it.
tree/forest/v7/src/RField.cxx
+
12
−
0
View file @
f736df07
...
...
@@ -49,10 +49,13 @@ ROOT::Experimental::Detail::RFieldBase::Create(const std::string &fieldName, con
{
std
::
string
normalizedType
(
typeName
);
normalizedType
.
erase
(
remove_if
(
normalizedType
.
begin
(),
normalizedType
.
end
(),
isspace
),
normalizedType
.
end
());
if
(
normalizedType
==
"Double_t"
)
normalizedType
=
"double"
;
if
(
normalizedType
==
"Int_t"
)
normalizedType
=
"std::int32_t"
;
if
(
normalizedType
==
"string"
)
normalizedType
=
"std::string"
;
if
(
normalizedType
.
substr
(
0
,
7
)
==
"vector<"
)
normalizedType
=
"std::"
+
normalizedType
;
if
(
normalizedType
==
"ROOT::Experimental::ClusterSize_t"
)
return
new
RField
<
ClusterSize_t
>
(
fieldName
);
if
(
normalizedType
==
"std::int32_t"
)
return
new
RField
<
std
::
int32_t
>
(
fieldName
);
if
(
normalizedType
==
"std::uint32_t"
)
return
new
RField
<
std
::
uint32_t
>
(
fieldName
);
if
(
normalizedType
==
"float"
)
return
new
RField
<
float
>
(
fieldName
);
if
(
normalizedType
==
"double"
)
return
new
RField
<
double
>
(
fieldName
);
...
...
@@ -235,6 +238,15 @@ void ROOT::Experimental::RField<double>::DoGenerateColumns()
}
//------------------------------------------------------------------------------
void
ROOT
::
Experimental
::
RField
<
std
::
int32_t
>::
DoGenerateColumns
()
{
RColumnModel
model
(
GetName
(),
EColumnType
::
kInt32
,
false
/* isSorted*/
);
fColumns
.
emplace_back
(
std
::
make_unique
<
Detail
::
RColumn
>
(
model
));
fPrincipalColumn
=
fColumns
[
0
].
get
();
}
//------------------------------------------------------------------------------
void
ROOT
::
Experimental
::
RField
<
std
::
uint32_t
>::
DoGenerateColumns
()
...
...
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