Blender V4.3
RandGen.cpp File Reference

Pseudo-random number generator. More...

#include "RandGen.h"
#include "BLI_sys_types.h"

Go to the source code of this file.

Namespaces

namespace  Freestyle
 inherits from class Rep
 

Macros

#define N   16
 
#define MASK   (uint(1 << (N - 1)) + (1 << (N - 1)) - 1)
 
#define X0   0x330E
 
#define X1   0xABCD
 
#define X2   0x1234
 
#define A0   0xE66D
 
#define A1   0xDEEC
 
#define A2   0x5
 
#define C   0xB
 
#define LOW(x)   (uint(x) & MASK)
 
#define HIGH(x)   LOW((x) >> N)
 
#define MUL(x, y, z)
 
#define CARRY(x, y)   (ulong(long(x) + long(y)) > MASK)
 
#define ADDEQU(x, y, z)   (z = CARRY(x, (y)), x = LOW(x + (y)))
 
#define SET3(x, x0, x1, x2)   ((x)[0] = (x0), (x)[1] = (x1), (x)[2] = (x2))
 
#define SEED(x0, x1, x2)   (SET3(x, x0, x1, x2), SET3(a, A0, A1, A2), c = C)
 

Variables

static uint Freestyle::x [3]
 
static uint Freestyle::a [3]
 
static uint Freestyle::c = C
 

Detailed Description

Pseudo-random number generator.

Definition in file RandGen.cpp.

Macro Definition Documentation

◆ A0

#define A0   0xE66D

◆ A1

◆ A2

◆ ADDEQU

#define ADDEQU ( x,
y,
z )   (z = CARRY(x, (y)), x = LOW(x + (y)))

Definition at line 46 of file RandGen.cpp.

◆ C

#define C   0xB

Definition at line 29 of file RandGen.cpp.

Referenced by ABC_import(), libmv::euclidean_resection::AbsoluteOrientation(), blender::nodes::socket_items::ops::add_item(), blender::ed::asset::ASSET_OT_clear(), blender::ed::asset::ASSET_OT_clear_single(), blender::ed::asset::ASSET_OT_mark(), blender::ed::asset::ASSET_OT_mark_single(), BLI_ewa_filter(), BLI_ewa_imp2radangle(), bpy_context_temp_override(), brush_edit_apply(), btDoSimplex3(), btDoSimplex4(), calculateTransformCenter(), channel_draw_context_init(), Freestyle::FEdgeXDetector::computeCurvatures(), libmv::ComputeTrackingEquation(), slim::cotmatrix(), slim::cotmatrix_entries(), CTX_copy(), CTX_create(), ED_region_do_draw(), ED_view3d_viewcontext_init(), EffectsExporter::exportEffects(), blender::ui::eyedropper_colorband_sample_segment(), blender::ed::asset::shelf::header_regiontype_register(), initTransform(), lineart_bake_common(), blender::ed::space_node::link_drag_search_exec_fn(), main(), libmv::euclidean_resection::MatrixToConstraint(), md5_process_block(), menu_items_from_all_operators(), blender::nodes::socket_items::ops::move_active_item(), btMatrixX< T >::multiply2_p8r(), btMatrixX< T >::multiplyAdd2_p8r(), blender::ed::space_node::node_get_invalid_links_extra_info(), Freestyle::Functions0D::Curvature2DAngleF0D::operator()(), Freestyle::Functions0D::VertexOrientation2DF0D::operator()(), Freestyle::Functions0D::VertexOrientation3DF0D::operator()(), blender::ed::outliner::outliner_modifier_operation_exec(), pack_islands_exec(), blender::ed::sculpt_paint::paint_cursor_context_init(), PE_set_data(), previews_ensure_exec(), blender::ed::greasepencil::primitive_calulate_curve_positions(), region_poll(), blender::nodes::socket_items::ops::remove_active_item(), blender::nodes::socket_items::ops::remove_item_by_index(), RNA_property_enum_items_ex(), rna_property_update(), Freestyle::PythonInterpreter::setContext(), template_operator_property_buts_draw_single(), timeline_draw_context_get(), transform_modal(), transformApply(), transformEnd(), ui_layout_operator_properties_only_booleans(), blender::io::usd::USD_import(), and blender::ed::view3d::geometry_nodes_gizmos::WIDGETGROUP_geometry_nodes_refresh().

◆ CARRY

#define CARRY ( x,
y )   (ulong(long(x) + long(y)) > MASK)

Definition at line 45 of file RandGen.cpp.

◆ HIGH

#define HIGH ( x)    LOW((x) >> N)

Definition at line 35 of file RandGen.cpp.

Referenced by Freestyle::RandGen::srand48().

◆ LOW

#define LOW ( x)    (uint(x) & MASK)

Definition at line 34 of file RandGen.cpp.

Referenced by Freestyle::RandGen::srand48().

◆ MASK

#define MASK   (uint(1 << (N - 1)) + (1 << (N - 1)) - 1)

Definition at line 22 of file RandGen.cpp.

◆ MUL

#define MUL ( x,
y,
z )
Value:
{ \
long l = long(x) * long(y); \
(z)[0] = LOW(l); \
(z)[1] = HIGH(l); \
} \
((void)0)
#define LOW(x)
Definition RandGen.cpp:34
#define HIGH(x)
Definition RandGen.cpp:35
ATTR_WARN_UNUSED_RESULT const BMLoop * l
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117

Definition at line 37 of file RandGen.cpp.

◆ N

#define N   16

Definition at line 21 of file RandGen.cpp.

◆ SEED

#define SEED ( x0,
x1,
x2 )   (SET3(x, x0, x1, x2), SET3(a, A0, A1, A2), c = C)

Definition at line 51 of file RandGen.cpp.

Referenced by Freestyle::RandGen::srand48().

◆ SET3

#define SET3 ( x,
x0,
x1,
x2 )   ((x)[0] = (x0), (x)[1] = (x1), (x)[2] = (x2))

Definition at line 47 of file RandGen.cpp.

◆ X0

#define X0   0x330E

Definition at line 23 of file RandGen.cpp.

Referenced by Freestyle::RandGen::srand48().

◆ X1

#define X1   0xABCD

Definition at line 24 of file RandGen.cpp.

Referenced by libmv::TEST().

◆ X2

#define X2   0x1234

Definition at line 25 of file RandGen.cpp.

Referenced by libmv::TEST().