text:
Medical Imaging Interaction Toolkit  2018.4.99-9a29ffc6 Medical Imaging Interaction Toolkit
mitk::DataStorage Class Referenceabstract

Data management class that handles 'was created by' relations. More...

#include <mitkDataStorage.h>

Inheritance diagram for mitk::DataStorage:
Collaboration diagram for mitk::DataStorage:

## Public Types

typedef DataStorage Self

typedef itk::Object Superclass

typedef itk::SmartPointer< SelfPointer

typedef itk::SmartPointer< const SelfConstPointer

typedef itk::VectorContainer< unsigned int, DataNode::PointerSetOfObjects
A Container of objects that is used as a result set of GetSubset() query operations (Set of. More...

typedef Message1< const DataNode * > DataStorageEvent

## Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const

virtual const char * GetClassName () const

virtual void Add (DataNode *node, const DataStorage::SetOfObjects *parents=nullptr)=0
Adds a DataNode containing a data object to its internal storage. More...

void Add (DataNode *node, DataNode *parent)
Convenience method to add a node that has one parent. More...

virtual void Remove (const DataNode *node)=0
Removes node from the DataStorage. More...

virtual bool Exists (const DataNode *node) const =0
Checks if a node exists in the DataStorage. More...

void Remove (const DataStorage::SetOfObjects *nodes)
Removes a set of nodes from the DataStorage. More...

SetOfObjects::ConstPointer GetSubset (const NodePredicateBase *condition) const
returns a set of data objects that meet the given condition(s) More...

virtual SetOfObjects::ConstPointer GetSources (const DataNode *node, const NodePredicateBase *condition=nullptr, bool onlyDirectSources=true) const =0
returns a set of source objects for a given node that meet the given condition(s). More...

virtual SetOfObjects::ConstPointer GetDerivations (const DataNode *node, const NodePredicateBase *condition=nullptr, bool onlyDirectDerivations=true) const =0
returns a set of derived objects for a given node. More...

virtual SetOfObjects::ConstPointer GetAll () const =0
returns a set of all data objects that are stored in the data storage More...

DataNodeGetNode (const NodePredicateBase *condition=nullptr) const
Convenience method to get the first node that matches the predicate condition. More...

DataNodeGetNamedNode (const char *name) const
Convenience method to get the first node with a given name. More...

DataNodeGetNamedNode (const std::string name) const
Convenience method to get the first node with a given name. More...

DataNodeGetNamedDerivedNode (const char *name, const DataNode *sourceNode, bool onlyDirectDerivations=true) const
Convenience method to get the first node with a given name that is derived from sourceNode. More...

template<class DataType >
DataType * GetNamedObject (const char *name) const
Convenience method to get the first data object of a given data type with a given name. More...

template<class DataType >
DataType * GetNamedObject (const std::string name) const
Convenience method to get the first data object of a given data type with a given name. More...

template<class DataType >
DataType * GetNamedDerivedObject (const char *name, const DataNode *sourceNode, bool onlyDirectDerivations=true) const
Convenience method to get the first data object of a given data type with a given name that is derived. More...

const DataNode::GroupTagList GetGroupTags () const
Returns a list of used grouptags. More...

TimeGeometry::ConstPointer ComputeBoundingGeometry3D (const SetOfObjects *input, const char *boolPropertyKey=nullptr, const BaseRenderer *renderer=nullptr, const char *boolPropertyKey2=nullptr) const
Compute the axis-parallel bounding geometry of the input objects. More...

TimeGeometry::ConstPointer ComputeBoundingGeometry3D (const char *boolPropertyKey=nullptr, const BaseRenderer *renderer=nullptr, const char *boolPropertyKey2=nullptr) const
Compute the axis-parallel bounding geometry of the data tree (bounding box, minimal spacing of the considered nodes, live-span) More...

TimeGeometry::ConstPointer ComputeVisibleBoundingGeometry3D (const BaseRenderer *renderer=nullptr, const char *boolPropertyKey=nullptr)
Compute the axis-parallel bounding geometry of all visible parts of the data tree bounding box, minimal spacing of the considered nodes, live-span) More...

BoundingBox::Pointer ComputeBoundingBox (const char *boolPropertyKey=nullptr, const BaseRenderer *renderer=nullptr, const char *boolPropertyKey2=nullptr)
Compute the bounding box of data tree structure it -> an iterator to a data tree structure. More...

BoundingBox::Pointer ComputeVisibleBoundingBox (const BaseRenderer *renderer=nullptr, const char *boolPropertyKey=nullptr)
Compute the bounding box of all visible parts of the data tree structure, for general rendering or renderer specific visibility property checking. More...

TimeBounds ComputeTimeBounds (const char *boolPropertyKey, const BaseRenderer *renderer, const char *boolPropertyKey2)
Compute the time-bounds of the contents of a data tree structure. More...

TimeBounds ComputeTimeBounds (const BaseRenderer *renderer, const char *boolPropertyKey)
Compute the time-bounds of all visible parts of the data tree structure, for general rendering or renderer specific visibility property checking. More...

void BlockNodeModifiedEvents (bool block)
Defines whether or not NodeChangedEvent is invoked . More...

## Static Public Member Functions

static const char * GetStaticNameOfClass ()

## Public Attributes

itk::SimpleFastMutexLock m_MutexOne

AddEvent is emitted whenever a new node has been added to the DataStorage. More...

DataStorageEvent RemoveNodeEvent
RemoveEvent is emitted directly before a node is removed from the DataStorage. More...

DataStorageEvent ChangedNodeEvent
ChangedEvent is emitted directly after a node was changed. More...

DataStorageEvent DeleteNodeEvent
DeleteNodeEvent is emitted directly before a node is deleted. More...

DataStorageEvent InteractorChangedNodeEvent

## Protected Member Functions

void EmitAddNodeEvent (const DataNode *node)

void EmitRemoveNodeEvent (const DataNode *node)
EmitRemoveNodeEvent emits the RemoveNodeEvent. More...

void OnNodeInteractorChanged (itk::Object *caller, const itk::EventObject &event)

void OnNodeModifiedOrDeleted (const itk::Object *caller, const itk::EventObject &event)
OnNodeModified listens to modified events of DataNodes. More...

void AddListeners (const DataNode *_Node)
Adds a Modified-Listener to the given Node. More...

void RemoveListeners (const DataNode *_Node)
Removes a Modified-Listener from the given Node. More...

DataStorage ()
Standard Constructor for ::New() instantiation. More...

~DataStorage () override
Standard Destructor. More...

SetOfObjects::ConstPointer FilterSetOfObjects (const SetOfObjects *set, const NodePredicateBase *condition) const
Filters a SetOfObjects by the condition. If no condition is provided, the original set is returned. More...

void PrintSelf (std::ostream &os, itk::Indent indent) const override
Prints the contents of the DataStorage to os. Do not call directly, call ->Print() instead. More...

## Protected Attributes

std::map< const DataNode *, unsigned long > m_NodeModifiedObserverTags
Saves Modified-Observer Tags for each node in order to remove the event listeners again. More...

std::map< const DataNode *, unsigned long > m_NodeInteractorChangedObserverTags

std::map< const DataNode *, unsigned long > m_NodeDeleteObserverTags
Saves Delete-Observer Tags for each node in order to remove the event listeners again. More...

bool m_BlockNodeModifiedEvents
If this class changes nodes itself, set this to TRUE in order to suppress NodeChangedEvent to be emitted. More...

## Detailed Description

Data management class that handles 'was created by' relations.

The DataStorage provides data storage and management functionality. It handles a 'was created by' relation by associating each data object with a set of source objects, that this object was created from. Thus, nodes are stored in a noncyclical directed graph data structure. If a new node is added to the DataStorage, AddNodeEvent is emitted. If a node is removed, RemoveNodeEvent is emitted.

Definition at line 43 of file mitkDataStorage.h.

## ◆ ConstPointer

 typedef itk::SmartPointer mitk::DataStorage::ConstPointer

Definition at line 46 of file mitkDataStorage.h.

## ◆ DataStorageEvent

 typedef Message1 mitk::DataStorage::DataStorageEvent

Definition at line 200 of file mitkDataStorage.h.

## ◆ Pointer

Definition at line 46 of file mitkDataStorage.h.

## ◆ Self

 typedef DataStorage mitk::DataStorage::Self

Definition at line 46 of file mitkDataStorage.h.

## ◆ SetOfObjects

 typedef itk::VectorContainer mitk::DataStorage::SetOfObjects

A Container of objects that is used as a result set of GetSubset() query operations (Set of.

Definition at line 46 of file mitkDataStorage.h.

## ◆ Superclass

 typedef itk::Object mitk::DataStorage::Superclass

Definition at line 46 of file mitkDataStorage.h.

## ◆ DataStorage()

 mitk::DataStorage::DataStorage ( )
protected

Standard Constructor for ::New() instantiation.

Definition at line 25 of file mitkDataStorage.cpp.

## ◆ ~DataStorage()

 mitk::DataStorage::~DataStorage ( )
overrideprotected

Standard Destructor.

Definition at line 29 of file mitkDataStorage.cpp.

## ◆ Add() [1/2]

 virtual void mitk::DataStorage::Add ( DataNode * node, const DataStorage::SetOfObjects * parents = nullptr )
pure virtual

Adds a DataNode containing a data object to its internal storage.

This Method adds a new data object to the DataStorage. The new object is passed in the first parameter. The second parameter is a set of source objects, that were used to create this object. The new object will have a 'was created from' relation to its source objects. the addition of a new object will fire the notification mechanism. If the node parameter is nullptr or if the DataNode has already been added, an exception will be thrown.

Implemented in mitk::StandaloneDataStorage.

## ◆ Add() [2/2]

 void mitk::DataStorage::Add ( DataNode * node, DataNode * parent )

Convenience method to add a node that has one parent.

Definition at line 39 of file mitkDataStorage.cpp.

 void mitk::DataStorage::AddListeners ( const DataNode * _Node )
protected

Adds a Modified-Listener to the given Node.

Definition at line 211 of file mitkDataStorage.cpp.

## ◆ BlockNodeModifiedEvents()

 void mitk::DataStorage::BlockNodeModifiedEvents ( bool block )

Defines whether or not NodeChangedEvent is invoked .

This method can be used to set m_BlockNodeModifiedEvents.

If this flag is true, NodeChangedEvent is not invoked when a DataNode is modified. This might be undesired when setting many properties on a datanode and you do not want anyone to react.

Definition at line 508 of file mitkDataStorage.cpp.

References m_BlockNodeModifiedEvents.

## ◆ ComputeBoundingBox()

 mitk::BoundingBox::Pointer mitk::DataStorage::ComputeBoundingBox ( const char * boolPropertyKey = nullptr, const BaseRenderer * renderer = nullptr, const char * boolPropertyKey2 = nullptr )

Compute the bounding box of data tree structure it -> an iterator to a data tree structure.

Parameters
 boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for renderer) and is set to false, the node is ignored for the bounding-box calculation. renderer see boolPropertyKey boolPropertyKey2 a second condition that is applied additionally to boolPropertyKey

Definition at line 411 of file mitkDataStorage.cpp.

Referenced by mitk::CameraController::SetStandardView().

## ◆ ComputeBoundingGeometry3D() [1/2]

 mitk::TimeGeometry::ConstPointer mitk::DataStorage::ComputeBoundingGeometry3D ( const SetOfObjects * input, const char * boolPropertyKey = nullptr, const BaseRenderer * renderer = nullptr, const char * boolPropertyKey2 = nullptr ) const

Compute the axis-parallel bounding geometry of the input objects.

Throws std::invalid_argument exception if input is nullptr

Parameters
 input set of objects of the DataStorage to be included in the bounding geometry boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for renderer) and is set to false, the node is ignored for the bounding-box calculation. renderer see boolPropertyKey boolPropertyKey2 a second condition that is applied additionally to boolPropertyKey

Definition at line 255 of file mitkDataStorage.cpp.

## ◆ ComputeBoundingGeometry3D() [2/2]

 mitk::TimeGeometry::ConstPointer mitk::DataStorage::ComputeBoundingGeometry3D ( const char * boolPropertyKey = nullptr, const BaseRenderer * renderer = nullptr, const char * boolPropertyKey2 = nullptr ) const

Compute the axis-parallel bounding geometry of the data tree (bounding box, minimal spacing of the considered nodes, live-span)

it -> an iterator to a data tree structure

Parameters
 boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for renderer) and is set to false, the node is ignored for the bounding-box calculation. renderer see boolPropertyKey boolPropertyKey2 a second condition that is applied additionally to boolPropertyKey

Definition at line 398 of file mitkDataStorage.cpp.

References ComputeBoundingGeometry3D(), and GetAll().

## ◆ ComputeTimeBounds() [1/2]

 mitk::TimeBounds mitk::DataStorage::ComputeTimeBounds ( const char * boolPropertyKey, const BaseRenderer * renderer, const char * boolPropertyKey2 )

Compute the time-bounds of the contents of a data tree structure.

The methods returns only [-infinity, +infinity], if all data-objects have an infinite live-span. Otherwise, all data-objects with infinite live-span are ignored. it -> an iterator to a data tree structure

Parameters
 boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for renderer) and is set to false, the node is ignored for the time-bounds calculation. renderer see boolPropertyKey boolPropertyKey2 a second condition that is applied additionally to boolPropertyKey

Definition at line 463 of file mitkDataStorage.cpp.

References GetAll(), mitk::TimeGeometry::GetTimeBounds(), and max().

## ◆ ComputeTimeBounds() [2/2]

 TimeBounds mitk::DataStorage::ComputeTimeBounds ( const BaseRenderer * renderer, const char * boolPropertyKey )
inline

Compute the time-bounds of all visible parts of the data tree structure, for general rendering or renderer specific visibility property checking.

The methods returns only [-infinity, +infinity], if all data-objects have an infinite live-span. Otherwise, all data-objects with infinite live-span are ignored. Simply calls ComputeTimeBounds(it, "visible", renderer, boolPropertyKey).

Parameters
 it an iterator to a data tree structure boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for renderer) and is set to false, the node is ignored for the time-bounds calculation. renderer see boolPropertyKey

Definition at line 358 of file mitkDataStorage.h.

## ◆ ComputeVisibleBoundingBox()

 BoundingBox::Pointer mitk::DataStorage::ComputeVisibleBoundingBox ( const BaseRenderer * renderer = nullptr, const char * boolPropertyKey = nullptr )
inline

Compute the bounding box of all visible parts of the data tree structure, for general rendering or renderer specific visibility property checking.

Simply calls ComputeBoundingBox(it, "visible", renderer, boolPropertyKey). it -> an iterator of a data tree structure

Parameters
 renderer the reference to the renderer boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for renderer) and is set to false, the node is ignored for the bounding-box calculation.

Definition at line 327 of file mitkDataStorage.h.

## ◆ ComputeVisibleBoundingGeometry3D()

 mitk::TimeGeometry::ConstPointer mitk::DataStorage::ComputeVisibleBoundingGeometry3D ( const BaseRenderer * renderer = nullptr, const char * boolPropertyKey = nullptr )

Compute the axis-parallel bounding geometry of all visible parts of the data tree bounding box, minimal spacing of the considered nodes, live-span)

Simply calls ComputeBoundingGeometry3D(it, "visible", renderer, boolPropertyKey). it -> an iterator of a data tree structure

Parameters
 renderer the reference to the renderer boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for renderer) and is set to false, the node is ignored for the bounding-box calculation.

Definition at line 405 of file mitkDataStorage.cpp.

References ComputeBoundingGeometry3D().

 void mitk::DataStorage::EmitAddNodeEvent ( const DataNode * node )
protected

This method should be called by subclasses to emit the AddNodeEvent

Definition at line 176 of file mitkDataStorage.cpp.

References AddNodeEvent, and mitk::Message1< T, A >::Send().

## ◆ EmitRemoveNodeEvent()

 void mitk::DataStorage::EmitRemoveNodeEvent ( const DataNode * node )
protected

EmitRemoveNodeEvent emits the RemoveNodeEvent.

This method should be called by subclasses to emit the RemoveNodeEvent

Definition at line 181 of file mitkDataStorage.cpp.

References RemoveNodeEvent, and mitk::Message1< T, A >::Send().

Referenced by mitk::StandaloneDataStorage::Remove().

## ◆ Exists()

 virtual bool mitk::DataStorage::Exists ( const DataNode * node ) const
pure virtual

Checks if a node exists in the DataStorage.

Implemented in mitk::StandaloneDataStorage.

## ◆ FilterSetOfObjects()

 mitk::DataStorage::SetOfObjects::ConstPointer mitk::DataStorage::FilterSetOfObjects ( const SetOfObjects * set, const NodePredicateBase * condition ) const
protected

Filters a SetOfObjects by the condition. If no condition is provided, the original set is returned.

Definition at line 140 of file mitkDataStorage.cpp.

References mitk::NodePredicateBase::CheckNode().

Referenced by mitk::StandaloneDataStorage::GetRelations(), and GetSubset().

## ◆ GetAll()

 virtual SetOfObjects::ConstPointer mitk::DataStorage::GetAll ( ) const
pure virtual

returns a set of all data objects that are stored in the data storage

Implemented in mitk::StandaloneDataStorage.

## ◆ GetClassHierarchy()

 virtual std::vector mitk::DataStorage::GetClassHierarchy ( ) const
inlinevirtual

Reimplemented in mitk::StandaloneDataStorage.

Definition at line 46 of file mitkDataStorage.h.

## ◆ GetClassName()

 virtual const char* mitk::DataStorage::GetClassName ( ) const
virtual

Reimplemented in mitk::StandaloneDataStorage.

## ◆ GetDerivations()

 virtual SetOfObjects::ConstPointer mitk::DataStorage::GetDerivations ( const DataNode * node, const NodePredicateBase * condition = nullptr, bool onlyDirectDerivations = true ) const
pure virtual

returns a set of derived objects for a given node.

GetDerivations() returns a set of objects that are derived from the DataNode node. This means, that node was used to create the returned objects. If the parameter onlyDirectDerivations is set to true (default value), only objects that directly have node as one of their source objects will be returned. Otherwise, objects that are derived from derivations of node are returned too. The derived objects can be filtered with a predicate object as described in the GetSubset() method by providing a predicate as the condition parameter.

Implemented in mitk::StandaloneDataStorage.

## ◆ GetGroupTags()

 const mitk::DataNode::GroupTagList mitk::DataStorage::GetGroupTags ( ) const

Returns a list of used grouptags.

Definition at line 156 of file mitkDataStorage.cpp.

References GetAll(), and mitk::PropertyList::GetMap().

Referenced by TestDataStorage().

## ◆ GetNamedDerivedNode()

 mitk::DataNode * mitk::DataStorage::GetNamedDerivedNode ( const char * name, const DataNode * sourceNode, bool onlyDirectDerivations = true ) const

Convenience method to get the first node with a given name that is derived from sourceNode.

Definition at line 88 of file mitkDataStorage.cpp.

Referenced by TestDataStorage().

## ◆ GetNamedDerivedObject()

template<class DataType >
 DataType* mitk::DataStorage::GetNamedDerivedObject ( const char * name, const DataNode * sourceNode, bool onlyDirectDerivations = true ) const
inline

Convenience method to get the first data object of a given data type with a given name that is derived.

Definition at line 178 of file mitkDataStorage.h.

References mitk::DataNode::GetData().

## ◆ GetNamedNode() [1/2]

 mitk::DataNode * mitk::DataStorage::GetNamedNode ( const char * name ) const

Convenience method to get the first node with a given name.

Definition at line 61 of file mitkDataStorage.cpp.

## ◆ GetNamedNode() [2/2]

 DataNode* mitk::DataStorage::GetNamedNode ( const std::string name ) const
inline

Convenience method to get the first node with a given name.

Definition at line 142 of file mitkDataStorage.h.

References GetNamedNode().

Referenced by GetNamedNode().

## ◆ GetNamedObject() [1/2]

template<class DataType >
 DataType* mitk::DataStorage::GetNamedObject ( const char * name ) const
inline

Convenience method to get the first data object of a given data type with a given name.

Definition at line 154 of file mitkDataStorage.h.

References mitk::DataNode::GetData().

Referenced by QmitkAdaptiveRegionGrowingToolGUI::ConfirmSegmentation(), and TestDataStorage().

## ◆ GetNamedObject() [2/2]

template<class DataType >
 DataType* mitk::DataStorage::GetNamedObject ( const std::string name ) const
inline

Convenience method to get the first data object of a given data type with a given name.

Definition at line 168 of file mitkDataStorage.h.

## ◆ GetNode()

 mitk::DataNode * mitk::DataStorage::GetNode ( const NodePredicateBase * condition = nullptr ) const

Convenience method to get the first node that matches the predicate condition.

Definition at line 76 of file mitkDataStorage.cpp.

References GetSubset().

Referenced by TestDataStorage().

## ◆ GetSources()

 virtual SetOfObjects::ConstPointer mitk::DataStorage::GetSources ( const DataNode * node, const NodePredicateBase * condition = nullptr, bool onlyDirectSources = true ) const
pure virtual

returns a set of source objects for a given node that meet the given condition(s).

Implemented in mitk::StandaloneDataStorage.

Referenced by PrintSelf(), mitk::SceneIO::SaveScene(), and TestDataStorage().

## ◆ GetStaticNameOfClass()

 static const char* mitk::DataStorage::GetStaticNameOfClass ( )
inlinestatic

Definition at line 46 of file mitkDataStorage.h.

## ◆ GetSubset()

 mitk::DataStorage::SetOfObjects::ConstPointer mitk::DataStorage::GetSubset ( const NodePredicateBase * condition ) const

returns a set of data objects that meet the given condition(s)

GetSubset returns a set of objects with a specific data type that meet the condition(s) specified in the condition parameter. Conditions can be

• data type of the data object
• is source object of specific object (e.g. all source objects of node x)
• has property with specific value (e.g. OrganType is Liver)
• negation of any condition
• conjunction of a set of conditions
• disjunction of a set of conditions Conditions are implemented as predicates using the Composite Design Pattern (see definition of NodePredicateBase for details). The method returns a set of SmartPointers to the DataNodes that fulfill the conditions. A set of all objects can be retrieved with the GetAll() method;

Definition at line 55 of file mitkDataStorage.cpp.

References FilterSetOfObjects(), and GetAll().

## ◆ OnNodeInteractorChanged()

 void mitk::DataStorage::OnNodeInteractorChanged ( itk::Object * caller, const itk::EventObject & event )
protected

Definition at line 186 of file mitkDataStorage.cpp.

References InteractorChangedNodeEvent, and mitk::Message1< T, A >::Send().

## ◆ OnNodeModifiedOrDeleted()

 void mitk::DataStorage::OnNodeModifiedOrDeleted ( const itk::Object * caller, const itk::EventObject & event )
protected

OnNodeModified listens to modified events of DataNodes.

The node is hidden behind the caller parameter, which has to be casted first. If the cast succeeds the ChangedNodeEvent is emitted with this node.

Definition at line 195 of file mitkDataStorage.cpp.

## ◆ PrintSelf()

 void mitk::DataStorage::PrintSelf ( std::ostream & os, itk::Indent indent ) const
overrideprotected

Prints the contents of the DataStorage to os. Do not call directly, call ->Print() instead.

Definition at line 104 of file mitkDataStorage.cpp.

References GetAll(), GetDerivations(), and GetSources().

Referenced by mitk::StandaloneDataStorage::PrintSelf().

## ◆ Remove() [2/2]

 void mitk::DataStorage::Remove ( const DataStorage::SetOfObjects * nodes )

Removes a set of nodes from the DataStorage.

Definition at line 47 of file mitkDataStorage.cpp.

References Remove().

## ◆ RemoveListeners()

 void mitk::DataStorage::RemoveListeners ( const DataNode * _Node )
protected

Removes a Modified-Listener from the given Node.

Definition at line 236 of file mitkDataStorage.cpp.

## Member Data Documentation

AddEvent is emitted whenever a new node has been added to the DataStorage.

Observers should register to this event by calling myDataStorage->AddNodeEvent.AddListener(myObject,

Definition at line 215 of file mitkDataStorage.h.

## ◆ ChangedNodeEvent

 DataStorageEvent mitk::DataStorage::ChangedNodeEvent

ChangedEvent is emitted directly after a node was changed.

Observers should register to this event by calling myDataStorage->ChangedNodeEvent.AddListener(myObject,

Definition at line 248 of file mitkDataStorage.h.

Referenced by OnNodeModifiedOrDeleted(), and QmitkAbstractDataStorageModel::SetDataStorage().

## ◆ DeleteNodeEvent

 DataStorageEvent mitk::DataStorage::DeleteNodeEvent

DeleteNodeEvent is emitted directly before a node is deleted.

Observers should register to this event by calling myDataStorage->DeleteNodeEvent.AddListener(myObject,

Definition at line 264 of file mitkDataStorage.h.

Referenced by OnNodeModifiedOrDeleted().

## ◆ InteractorChangedNodeEvent

 DataStorageEvent mitk::DataStorage::InteractorChangedNodeEvent

Definition at line 266 of file mitkDataStorage.h.

Referenced by OnNodeInteractorChanged().

## ◆ m_BlockNodeModifiedEvents

 bool mitk::DataStorage::m_BlockNodeModifiedEvents
protected

If this class changes nodes itself, set this to TRUE in order to suppress NodeChangedEvent to be emitted.

Definition at line 417 of file mitkDataStorage.h.

Referenced by BlockNodeModifiedEvents(), and OnNodeModifiedOrDeleted().

## ◆ m_MutexOne

 itk::SimpleFastMutexLock mitk::DataStorage::m_MutexOne
mutable

Definition at line 197 of file mitkDataStorage.h.

Referenced by AddListeners(), and RemoveListeners().

## ◆ m_NodeDeleteObserverTags

 std::map mitk::DataStorage::m_NodeDeleteObserverTags
protected

Saves Delete-Observer Tags for each node in order to remove the event listeners again.

Definition at line 412 of file mitkDataStorage.h.

Referenced by AddListeners(), and RemoveListeners().

## ◆ m_NodeInteractorChangedObserverTags

 std::map mitk::DataStorage::m_NodeInteractorChangedObserverTags
protected

Definition at line 408 of file mitkDataStorage.h.

Referenced by AddListeners(), and RemoveListeners().

## ◆ m_NodeModifiedObserverTags

 std::map mitk::DataStorage::m_NodeModifiedObserverTags
protected

Saves Modified-Observer Tags for each node in order to remove the event listeners again.

Definition at line 406 of file mitkDataStorage.h.

Referenced by AddListeners(), and RemoveListeners().

## ◆ RemoveNodeEvent

 DataStorageEvent mitk::DataStorage::RemoveNodeEvent

RemoveEvent is emitted directly before a node is removed from the DataStorage.

Observers should register to this event by calling myDataStorage->RemoveNodeEvent.AddListener(myObject,

Definition at line 232 of file mitkDataStorage.h.

The documentation for this class was generated from the following files:


text:
# Taking Logarithm and Exponentiating

If some expression A is formed from positive numbers with help of operations of multiplication, division and raising to power, then, using properties of logarithms, we can express log_a(A) in terms of logarithms of numbers that expression A contains. Such transformation is called taking logarithm.

Example 1. Take logarithm with base 5 of the expression (125 a^3 b^2)/(sqrt(c)), where a,b,c are positive numbers.

Using properties of logarithms we obtain that log_5((125a^3b^2)/(sqrt(c)))=log_5(125a^3b^2)-log_5(sqrt(c))=log_5(125)+log_5(a^3)+log_5(b^2)-log_5(c^(1/2))=

=3+3log_5(a)+2log_5(b)-1/2log_5(c).

Very often we need to solve inverse task: knowing logarithm of expression, we need to find expression. Such transformation is called exponentiating.

Example 2. Find x if log_3(x)=2log_3(5)+1/2log_3(8)-3log_3(10).

We have that log_3(x)=log_3(5^2)+log_3(8^(1/2))-log_3(10^3)=log_3(25)+log_3(2sqrt(2))-log_3(1000)=log_3((25*2sqrt(2))/1000)=

=log_3((sqrt(2))/(20)).

Now from equality log_3(x)=log_3((sqrt(2))/(20)) we obtain that x=(sqrt(2))/(20).

format: plain


text:
• # question_answer A man is running along a road with speed u. On his chest there is a paper of mass m and area S. There is a wind blowing against the man at speed V. Density of air is$\rho$. Assume that the air molecules after striking the paper come to rest relative to the man. The minimum coefficient of friction between the paper and the chest so that the paper does not fall is A) $\frac{mg}{\rho S{{(V-u)}^{2}}}$        B)        $\frac{mg}{\rho S{{(2V-u)}^{2}}}$ C) $\frac{mg}{\rho S{{(V+u)}^{2}}}$      D)        $\frac{mg}{\rho S{{(2V+u)}^{2}}}$

[c] Volume of air striking the paper in unit time $=S(V+u)$ Mass of air striking the paper in unit time $=\rho S(V+u)$ In reference frame of man, the air molecules strike at a speed $(V+u)$ and comes to rest. $\therefore$ Rate of change of momentum for air particles $=\rho S(V+u)\,\,(V+u)$ $\therefore$ Force on paper due to air $=\rho S{{(V+u)}^{2}}$ For the paper to not fall, friction on it must balance its weight. ${{f}_{\max }}\ge mg$ $\mu \rho S\,\,{{(V+u)}^{2}}\ge mg$ $\mu \ge \frac{mg}{\rho S{{(V+u)}^{2}}}$


text:
# Francis Birch (geophysicist)

Albert Francis Birch
Francis Birch
BornAugust 22, 1903
Died30 January 1992 (aged 88)
Alma materHarvard University
Known forBirch's law
Birch-Murnaghan equation of state
Spouse(s)Barbara Channing
AwardsLegion of Merit (1945)
Arthur L. Day Medal (1950)
William Bowie Medal (1960)
National Medal of Science (1967)
Vetlesen Prize (1968)
Penrose Medal (1969)
Gold Medal of the Royal Astronomical Society (1973)
Scientific career
FieldsGeophysics
InstitutionsHarvard University
Signature

Francis Birch (August 22, 1903 – January 30, 1992) was an American geophysicist. He is considered one of the founders of solid Earth geophysics. He is also known for his part in the atomic bombing of Hiroshima and Nagasaki.

During World War II, Birch participated in the Manhattan Project, working on the design and development of the gun-type nuclear weapon known as Little Boy. He oversaw its manufacture, and went to Tinian to supervise its assembly and loading into Enola Gay, the Boeing B-29 Superfortress tasked with dropping the bomb.

A graduate of Harvard University, Birch began working on geophysics as a research assistant. He subsequently spent his entire career at Harvard working in the field, becoming an Associate Professor of Geology in 1943, a professor in 1946, and Sturgis Hooper Professor of Geology in 1949, and professor emeritus in 1974.

Birch published over 100 papers. He developed what is now known as the Birch-Murnaghan equation of state in 1947. In 1952 he demonstrated that Earth's mantle is chiefly composed of silicate minerals, with an inner and outer core of molten iron. In two 1961 papers on compressional wave velocities, he established what is now called Birch's law.

## Early life

Albert Francis Birch was born in Washington, D.C., on August 22, 1903, the son of George Albert Birch, who was involved in banking and real estate, and Mary Hemmick Birch, a church choir singer and soloist at St. Matthew's Cathedral in Washington, D.C. He had three younger brothers: David, who became a banker; John, who became a diplomat; and Robert, who became a songwriter. He was educated at Washington, D.C., schools, and Western High School, where he joined the High School Cadets in 1916.[1][2]

In 1920 Birch entered Harvard University on a scholarship. While there he served in Harvard's Reserve Officers' Training Corps Field Artillery Battalion. He graduated magna cum laude in 1924, and received his bachelor of science (S.B.) degree in electrical engineering.[1]

Birch went to work in the Engineering Department of the New York Telephone Company. He applied for and received an American Field Service Fellowship in 1926, which he used to travel to Strasbourg, and study at the University of Strasbourg's Institut de Physique under the tutelage of Pierre Weiss.[3] There, he wrote or co-wrote four papers, in French, on topics such as the paramagnetic properties of potassium cyanide, and the magnetic moment of Cu++ ions.[4]

On returning to the United States in 1928, Birch went back to Harvard to pursue physics. He was awarded his master of arts (A.M.) degree in 1929, and then commenced work on his 1932 doctor of philosophy (Ph.D.) degree under the supervision of Percy Bridgman,[3] who would receive the Nobel Prize for Physics in 1946. For his thesis, Birch measured the vapor-liquid critical point of mercury. He determined this as 1460±20 °C and 1640±50 kg/cm2, results he published in 1932 in the Physical Review.[4][5]

Around this time, there was an increased interest in geophysics at Harvard University, and Reginald Aldworth Daly established a Committee for Experimental Geology and Geophysics that included Bridgman, astronomer Harlow Shapley, geologists Louis Caryl Graton and D. H. McLaughlin and chemist G. P. Baxter. William Zisman, another one of Bridgman's Ph.D. students, was hired as the committee's research associate, but, having little interest in the study of rocks, he resigned in 1932. The position was then offered to Birch, who had little interest or experience in geology either, but with the advent of the Great Depression, jobs were hard to find, and he accepted. [6][7]

On July 15, 1933, Birch married Barbara Channing, a Bryn Mawr College alumna, and a collateral descendant of the theologian William Ellery Channing. They had three children: Anne Campaspe, Francis (Frank) Sylvanus and Mary Narcissa. Frank later became a professor of geophysics at the University of New Hampshire.[8][9]

## World War II

Birch (left) works on the Little Boy bomb while Norman F. Ramsey (right) looks on

In 1942, during World War II, Birch took a leave of absence from Harvard, in order to work at the Massachusetts Institute of Technology Radiation Laboratory, which was developing radar. He worked on the proximity fuze, a radar-triggered fuze that would explode a shell in the proximity of a target. The following year he accepted a commission in the United States Navy as a lieutenant commander, and was posted to the Bureau of Ships in Washington, D.C.[10]

Later that year he was assigned to the Manhattan Project, and moved with his family to Los Alamos, New Mexico. There he joined the Los Alamos Laboratory's Ordnance (O) Division, which was under the command of another Naval officer, Captain William S. Parsons. Initially the goal of the O Division was to design a gun-type nuclear weapon known as Thin Man. This proved to be impractical due to contamination of the reactor-bred plutonium with plutonium-240, and in February 1944, the Division switched its attention to the development of the Little Boy, a smaller device using uranium-235. Birch used unenriched uranium to create scale models and later full-scale mock-ups of the device.[11]

Birch supervised the manufacture of the Little Boy, and went to Tinian to supervise its assembly and loading it onto Enola Gay, the Boeing B-29 Superfortress tasked with dropping the bomb. He devised the 'double plug' system that allowed for actually arming the bomb after Enola Gay took off so that if it crashed, there would not be a nuclear explosion.[11] He was awarded the Legion of Merit. His citation read:

for exceptionally meritorious conduct in the performance of outstanding services to the Government of the United States in connection with the development of the greatest military weapon of all time, the atomic bomb. His initial assignment was the instrumentation of laboratory and field tests. He carried out this assignment in such outstanding fashion that he was placed in charge of the engineering and development of the first atomic bomb. He carried out this assignment with outstanding judgment and skill, and finally, went with the bomb to the advanced base where he insured, by his care and leadership, that the bomb was adequately prepared in every respect. Commander Birch's engineering ability, understanding of all principles involved, professional skill and devotion to duty throughout the development and delivery of the atomic bomb were outstanding and were in keeping with the highest traditions of the United States Naval Service.[12]

## Post-war

Birch returned to Harvard after the war ended, having been promoted to Associate Professor of Geology in 1943 while he was away. He would remain at Harvard for the rest of his career, becoming a professor in 1946, and Sturgis Hooper Professor of Geology in 1949, and professor emeritus in 1974. Professor Birch published over 100 papers.[2][3] He served as president of The Geological Society of America in 1964 and was awarded their Penrose Medal in 1969.[13]

In 1947, he adapted the isothermal Murnaghan equation of state, which had been developed for infinitesimal strain, for Eulerian finite strain, developing what is now known as the Birch-Murnaghan equation of state.[14]

Albert Francis Birch is known for his experimental work on the properties of Earth-forming minerals at high pressure and temperature, in 1952 he published a well-known paper in the Journal of Geophysical Research, where he demonstrated that the mantle is chiefly composed of silicate minerals, the upper and lower mantle are separated by a thin transition zone associated with silicate phase transitions, and the inner and outer core are alloys of crystalline and molten iron. His conclusions are still accepted as correct today. The most famous portion of the paper, however, is a humorous footnote he included in the introduction:[15][failed verification]

Unwary readers should take warning that ordinary language undergoes modification to a high-pressure form when applied to the interior of the Earth. A few examples of equivalents follow:

High Pressure Form Ordinary Meaning
Certain Dubious
Undoubtedly Perhaps
Positive proof Vague suggestion
Unanswerable argument Trivial objection
Pure iron Uncertain mixture of all the elements

In 1961, Birch published two papers on compressional wave velocities establishing a linear relation of the compressional wave velocity Vp of rocks and minerals of a constant average atomic weight ${\displaystyle {\bar {M}}}$ with density ${\displaystyle \rho }$ as:[16][17]

${\displaystyle V_{p}=a({\bar {M}})+b\rho }$.

This relationship became known as Birch's law. Birch was elected to the National Academy of Sciences in 1950,[18] and served as the president of the Geological Society of America in 1963 and 1964.[3] He received numerous honors in his career, including the Geological Society of America's Arthur L. Day Medal on 1950 and Penrose Medal in 1969, the American Geophysical Union's William Bowie Medal in 1960, the National Medal of Science from President Lyndon Johnson in 1967, the Vetlesen Prize (shared with Sir Edward Bullard) in 1968, the Gold Medal of the Royal Astronomical Society in 1973, and the International Association for the Advancement of High Pressure Research's Bridgman Medal in 1983.[19] Since 1992, the American Geophysical Union's Tectonophysics section has sponsored a Francis Birch Lecture, given at its annual meeting by a noted researcher in this field.[20]

Birch died of prostate cancer at his home in Cambridge, Massachusetts, on January 30, 1992. He was survived by wife Barbara, his three children and his three brothers.[2][18] His papers are in the Harvard University Archives.[3]

## Notes

1. ^ a b Ahrens 1998, p. 4.
2. ^ a b c Sullivan, Walter (February 5, 1992). "Francis Birch, Is Dead at 88; Was a Professor". The New York Times.
3. "Birch, Francis, 1903-1992. Papers of Francis Birch : an inventory ( HUGFP 132 )". Harvard University. Retrieved February 4, 2014.
4. ^ a b Ahrens 1998, p. 5.
5. ^ Birch, Francis (September 1932). "The Electrical Resistance and the Critical Point of Mercury". Physical Review. 41 (5): 641–648. Bibcode:1932PhRv...41..641B. doi:10.1103/PhysRev.41.641. ISSN 1050-2947.
6. ^ Ahrens 1998, p. 7.
7. ^ Birch, Francis (1979). "Reminiscences and digressions". Annual Review of Earth and Planetary Sciences. 7: 1–10. Bibcode:1979AREPS...7....1B. doi:10.1146/annurev.ea.07.050179.000245. ISSN 0084-6597.
8. ^ Ahrens 1998, p. 8.
9. ^ Sedgwick 1961, p. 245.
10. ^ Ahrens 1998, pp. 10–11.
11. ^ a b Ahrens 1998, pp. 11–13.
12. ^ "Valor awards for Albert Francis Birch". Military Times. Archived from the original on February 21, 2014. Retrieved February 6, 2014.
13. ^ Eckel, Edwin, 1982, GSA Memoir 155, The Geological Society of America — Life History of a Learned Society: Boulder, Colorado, Geological Society of America Memoir 155, 168 p., ISBN 0-8137-1155-X.
14. ^ Birch, Francis (June 1947). "Finite Elastic Strain of Cubic Crystals". Physical Review. 71 (11): 809–824. Bibcode:1947PhRv...71..809B. doi:10.1103/PhysRev.71.809. ISSN 1050-2947.
15. ^ Birch, Francis (June 1952). "Elasticity and Constitution of the Earth's Interior". Journal of Geophysical Research. 57 (2): 227–286. Bibcode:1952JGR....57..227B. doi:10.1029/JZ057i002p00227. ISSN 0148-0227.
16. ^ Birch, Francis (July 1961). "The velocity of Compressional Waves in Rocks to 10 kilobars. Part 2". Journal of Geophysical Research. 66 (7): 2199–2224. Bibcode:1961JGR....66.2199B. doi:10.1029/JZ066i007p02199. ISSN 0148-0227.
17. ^ Birch, Francis (December 1961). "Composition of the Earth's Mantle". Geophysical Journal of the Royal Astronomical Society. 4: 295–311. Bibcode:1961GeoJ....4..295B. doi:10.1111/j.1365-246X.1961.tb06821.x. ISSN 1365-246X.
18. ^ a b Shankland, Thomas; O'Connell, Richard (November 1992). "Obituary: Francis Birch". Physics Today. 45 (11): 105–106. Bibcode:1992PhT....45k.105S. doi:10.1063/1.2809890. ISSN 0031-9228. Archived from the original on October 4, 2013.
19. ^ Ahrens 1998, p. 20.
20. ^ Olsen, Kenneth. "Francis Birch (1903–1992)". American Geophysical Union. Retrieved February 6, 2014.


text:
# Find the sum of n terms of the series 3 + 7 + 14 + 24 + 37 + …….

## Solution :

By using method of differences,

The difference between the successive terms are 7 – 3 = 4, 14 – 7 = 7, 24 – 14 = 10, …. Clearly,these differences are in AP.

Let $$T_n$$ be the nth term and $$S_n$$ denote the sum to n terms of the given series

Then, $$S_n$$ = 3 + 7 + 14 + 24 + 37 + ….. + $$T_{n-1}$$ + $$T_n$$ ……(i)

Also, $$S_n$$ =         3 + 7 + 14 + 24 + 37 + ….. + $$T_{n-1}$$ + $$T_n$$ ……(ii)

Subtracting (ii) from (i), we get

0 = 3 + [4 + 7 + 10 + 13 + …… + $$T_{n-1}$$ + $$T_n$$] – $$T_n$$

$$\implies$$ $$T_n$$ = 3 + $$(n-1)\over 2$${2*4+(n-1-1)*3} = $$6 + (n-1)(3n+2)\over 4$$

$$\implies$$ $$T_n$$ = $$1\over 2$$ ($$3n^2 – n + 4$$)

$$\therefore$$ $$S_n$$ = $$\sum_{k=1}^{n}$$ $$T_k$$ = $$\sum_{k=1}^{n}$$ $$1\over 2$$ ($$3n^2 – n + 4$$) = $$1\over 2$$[$$\sum_{k=1}^{n}$$$$3k^2$$ – $$\sum_{k=1}^{n}$$ k + 4n]

$$\implies$$ $$S_n$$ = $$1\over 2$$[3$$n(n+1)(2n+1)\over 6$$  – $$n(n+1)\over 2$$ + 4n] = $$n\over 2$$ ($$n^2 + n + 4$$)

### Similar Questions

Find the sum of n terms of the series 1.3.5 + 3.5.7 + 5.7.9 + ……

Find the sum to n terms of the series : 3 + 15 + 35 + 63 + …..

If 100 times the 100th term of an AP with non-zero common difference equal to the 50 times its 50th term, then the 150th term of AP is

If x, y and z are in AP and $$tan^{-1}x$$, $$tan^{-1}y$$ and $$tan^{-1}z$$ are also in AP, then

Three positive integers form an increasing GP. If the middle term in this GP is doubled, then new numbers are in AP. Then the common ratio of GP is


text:
0 like 0 dislike
√180 can be expressed in the form p√q. where p and q are integers. Find the smallest value of p + q.

0 like 0 dislike
The smallest value of p+q is 11

It happens when p = 6 and q = 5.

=======================================================

Explanation:

Let's factor 180 in such a way that exactly one factor is a perfect square.

I'll ignore the trivial factor of 1.

Here are the possible factorizations we could go with:

180 = 4*45

180 = 9*20

180 = 36*5

Those factorizations then lead to the following

$$\sqrt{180} = \sqrt{4*45} = \sqrt{4}*\sqrt{45}= 2\sqrt{45}\\\\\sqrt{180} = \sqrt{9*20} = \sqrt{9}*\sqrt{20}= 3\sqrt{20}\\\\\sqrt{180} = \sqrt{36*5} = \sqrt{36}*\sqrt{5}= 6\sqrt{5}\\\\$$

Then we have

p+q = 2+45 = 47

p+q = 3+20 = 23

p+q = 6+5 = 11

The smallest value of p+q is 11 and it happens when p = 6 and q = 5.

Side note: p+q is smallest when we go with the largest perfect square factor.
by


text:
# MKCOM - Editorial

Practice

Contest

Author & Editorialist: Karthikeya

Easy-Medium

# PREREQUISITES:

Dynamic Programming

# PROBLEM:

You are given an M size array buildings, where 0 \leq buildings[i] \leq N. You are also given an M \times N size cost matrix, where cost[i][j] represents replacing buildings[i] with a positive number j(1\leq j \leq N) if buildings[i] is 0 initially.

A community is a maximal subarray of buildings in which all the numbers are same. For example: buildings = [1,1,1,2,2,1,3,3,3] has 4 communities - \{(1,1,1),(2,2),(1),(3,3,3)\}.

Find the minimum total cost of replacing all the 0's with a positive number j(1\leq j \leq N) such that there are exactly K communities in buildings. If it is not possible to have K communities return -1.

# QUICK EXPLANATION:

We can solve this in O(N^2MK) by using Dynamic Programming,

State:

DP(i,j,k) represents minimum cost of replacing all 0's in the subarray buildings[1,2,...i] such that buildings[i] is j and this subarray has exactly k communities. (1\leq i \leq M, 1\leq j \leq N, 1\leq k \leq K).

State Transition:

DP(i,j,k) = \left. \begin{cases} min[DP(i-1,j,k),min\{DP(i-1,p,k-1) \: \forall \: (1 \leq p \leq N, p \neq j)\}], & \text{if} (\textbf{buildings}[i] = j \: \text{and} \: k \leq i)\\ \textbf{cost}[i][j]+min[DP(i-1,j,k),min\{DP(i-1,p,k-1) \: \forall \: (1 \leq p \leq N, p \neq j)\}], & \text{if} (\textbf{buildings}[i] = 0 \: \text{and} \: k \leq i)\\ \infin, & \text{else} \end{cases} \right\}

# EXPLANATION:

This problem can be solved by Dynamic Programming. For any DP problem we need two things : State and State transition. So first let us define our state. To solve this problem we are using 3-dimensional DP.

State:

DP(i,j,k) represents minimum cost of replacing all 0's in the subarray buildings[1,2,...i] such that buildings[i] is j and this subarray has exactly k communities. (1\leq i \leq M, 1\leq j \leq N, 1\leq k \leq K).

Now let us figure out the state transition.

• Case 1: When \textbf{buildings}[i]=j, we can get k communities till i houses in two ways. One way is to have k communities such that the i^{th} building is the only one that belongs to k^{th} community, in this case we need to consider - min\{DP(i-1,p,k-1) \: \forall \: (1 \leq p \leq N, p \neq j)\} as we require the minimum cost. The other way is by having more than 1 buildings in the k^{th} community, so for this \textbf{buildings}[i-1] has to have j floor, hence we need to consider - DP(i-1,j,k). So from DP(i,j,k) would be the minimum of these two costs. One more thing to consider is, the above transitions are valid only for k \geq i, if it is not the case then it is impossible to have k communities. So the transition for the first case is,

\text{if} \; (\textbf{buildings}[i] = j \: \text{and} \: k \leq i):

\;\;\;\;DP(i,j,k) = min[DP(i-1,j,k),min\{DP(i-1,p,k-1) \: \forall \: (1 \leq p \leq N, p \neq j)\}]
• Case 2: When \textbf{buildings}[i]=0, in this case as \textbf{buildings}[i] is 0, we have to construct a building at i^{th} position with j floors. So the cost of construction would be \textbf{cost}[i][j] and the same transition which we had in the previous case would add up as it is, because once we construct a j floors building at the i^{th} index, we reduced this case to the first case. So the transition for this case would be,

\text{if} \; (\textbf{buildings}[i] = 0 \: \text{and} \: k \leq i):

\;\;\;\;DP(i,j,k) = \textbf{cost}[i][j]+ min[DP(i-1,j,k),min\{DP(i-1,p,k-1) \: \forall \: (1 \leq p \leq N, p \neq j)\}]
• In all other cases it is impossible to have k communities so we set the cost to \infin.

So the overall state transition would look like,

State Transition:

DP(i,j,k) = \left. \begin{cases} min[DP(i-1,j,k),min\{DP(i-1,p,k-1) \: \forall \: (1 \leq p \leq N, p \neq j)\}], & \text{if} (\textbf{buildings}[i] = j \: \text{and} \: k \leq i)\\ \textbf{cost}[i][j]+min[DP(i-1,j,k),min\{DP(i-1,p,k-1) \: \forall \: (1 \leq p \leq N, p \neq j)\}], & \text{if} (\textbf{buildings}[i] = 0 \: \text{and} \: k \leq i)\\ \infin, & \text{else} \end{cases} \right\}

Initialization: One way to initialize is to add a dummy index at the beginning so the dimension of DP table would become (M+1 \times N+1 \times K+1) and make it all zeros. Now set the DP[0][j][k] and DP[i][j][0] to \infin \forall i,j,k satisfying the constraints.

# TIME COMPLEXITY:

Time: O(N^2MK)

Space: O(NMK)

Note : Time can be reduced to O(NMK) and space can be reduced to O(NK) as this was the 3^{rd} question in the contest we set weaker constraints.

# SOLUTION:

Setter's Solution

Setters Solution:

def minCost(buildings, cost, m, n, k):
t = k
dp = [[[0 for i in range(t+1)] for j in range(n+1)] for i in range(m+1)]

for k in range(1,t+1):
for j in range(1,n+1):
dp[0][j][k] = float('inf')

for i in range(1,m+1):
for j in range(1,n+1):
dp[i][j][0] = float('inf')

for i in range(1,m+1):
for j in range(1,n+1):
for k in range(1,t+1):
if buildings[i-1] == j and k<=i:
dp[i][j][k] = min(dp[i-1][j][k],min([dp[i-1][p][k-1] if p!=j else float('inf') for p in range(1,n+1)]))
elif buildings[i-1]==0 and k<=i:
dp[i][j][k] = cost[i-1][j-1]+min(dp[i-1][j][k],min([dp[i-1][p][k-1] if p!=j else float('inf') for p in range(1,n+1)]))
else:
dp[i][j][k] = float("inf")

ans = float('inf')
for j in range(1,n+1):
ans = min(ans, dp[m][j][t])

return ans if ans<float('inf') else -1

for _ in range(int(input())):
m,n,k = [int(i) for i in input().split()]
buildings = [int(i) for i in input().split()]
cost = [[int(i) for i in input().split()] for j in range(m)]
print(minCost(buildings,cost,m,n,k))

1 Like


text: See below, I got one image above and one under. In this chapter, we introduce the possible options for these formats. You can label chapter and section titles using {#label} after them, e.g., we can reference Section 41.2. ## Usage {#usage} A typical **bookdown** book contains multiple chapters, and one chapter lives in one R Markdown file, with the filename extension .Rmd. ���� GOOD! On twitter I have seen developers selling ebooks and making good money. Changing chapter titles and possibly figure caption number formats (maybe "Figure 1.1. You can start editing and adding chapters. You can write citations, too.  {r} 2  Se lavoriamo a maglia, il index.Rmd bookdown unirà tutti i file nella stessa directory in ordine alfabetico (questo comportamento può essere modificato utilizzando un _bookdown.ymlfile aggiuntivo ). Note that each chapter should start with a level 1 header, which will be the title of the chapter. A minimal book example using bookdown. The bookdown package primarily supports three types of output formats: HTML, LaTeX/PDF, and e-books.  {r} 1  02-intro.Rmd: # Chapter 2 This is chapter 2. My _output.yml file looks like this: Note that this refers to a style.css file, which affects the appearance of your book. bookdown allows this to be changed in the _bookdown.yaml file link and I was wondering if there is something similar in pagedown that I am missing, or if it should be done a different way. the filename for the first chapter with a chapter title # Introduction will be introduction.html; for chapter+number and section+number, the chapter/section numbers will be prepended to the HTML filenames, e.g. Advantage of explicit identification: You are less likely to update the section header and then forget to make matching edits to references elsewhere in the book. This is similar to this question, but I would like the image to appear only before the title, not every top-level heading. You can edit your _bookdown.yml file, which controls the setup of your book. If you know youâre going to refer to something, this is probably a good idea. Context: you prefer to link with text, not a chapter or section number. Hands-On Data Visualization: Interactive Storytelling from Spreadsheets to Code is an open-access book-in-progress, under contract with O'Reilly Media. For more information on YAML you can head here or to the bookdown book.. One thing you���ll have to do for a thesis is create a title page. Package ���bookdown��� October 13, 2020 Type Package Title Authoring Books and Technical Documents with R Markdown Version 0.21 Maintainer Yihui Xie Description Output formats and utilities for authoring books and technical documents with R Markdown. Goal of the selectors is to ensure internal "margins", controlled only by padding of container */. A typical **bookdown** book contains multiple chapters, and one chapter lives in one R Markdown file, with the filename extension .Rmd. index.rmd). 23.2 訝���т묘���溫양쉰. save and execute code, and. The LaTeX syntax is like \chapter[short title]{long title}. bookdown: Authoring Books and Technical Documents with R Markdown presents a much easier way to write books and technical publications than traditional tools such as LaTeX and Word. For example, we are using the bookdown package (Xie 2020) in this sample book, which was built on top of R Markdown and knitr (Xie 2015). I've followed this thread and installed tinytex and most everything else. Output formats can be specified either in the YAML metadata of the first Rmd file of the book, or in a separate YAML file named _output.yml under the root directory of the book. Usage. After saving and knitting each chapter successfully, the finalized chapters can be included in the book build, and ordered, by adding them to the _bookdown.yml file, in between index.Rmd, and io98-title-holder.Rmd. # Chapter 1 This is chapter 1. A typical bookdown book contains multiple chapters, and one chapter lives in one R Markdown file, with the filename extension .Rmd. They will not be included until you list them in your _bookdown.yml file. The bookdown package ��� The YAML front matter. 1-introduction.html and 2-1-literature.html. Bookdown, an open-source software package by Yihui Xie at RStudio, allows authors to compose in Markdown, an easy-to-read-and-write cross-platform syntax, and create one workflow that produces books in multiple formats, such as HTML Web edition, PDF print edition, MS Word edition, ePUB edition, etc.Furthermore, Bookdown generates the Web edition as a set of static ��� .book .book-body .page-wrapper .page-inner section.normal div.rstudio-tip > :first-child, .book .book-body .page-wrapper .page-inner section.normal div.tip > :first-child {. Reference a figure by its code chunk label with the fig: prefix, e.g., see Figure 41.1. In order to cross-reference in Bookdown, assign a unique name or R code-chunk label to each chapter, section, figure, and table. To cross-reference any chapter or section, and allow readers to jump there, use a HTML link with the unique name, such as index.html or style-guide.html.Demos: See Preface; See ���Style Guide��� in Chapter x. Overview. background-image: url("images/explore.png"); background-color: #d0faee; /* green card background */, /* .book .book-body .page-wrapper .page-inner section.normal is needed, to override the styles produced by gitbook, which are ridiculously, overspecified. In this chapter, we introduce the possible options for these formats. Chapter 2 Basics. Similarly, you can reference tables generated from knitr::kable(), e.g., see Table 41.1. Each R Markdown file must start immediately with the chapter title using the first-level heading, e.g., # Chapter Title. - io98-title_holder.Rmd, Render the book with bookdown::render_book('index.html'), Publish the book with Use implicit reference alone to get a link where the text is exactly the section header: You can provide custom text for the link with all 3 methods of addressing a section. But I really would like to keep chapter numbering turned on so that figure/table numbers all work properly (i.e. I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space. 訝���х��bookdown嶸←�����阿�竊� 訝���ф�양쉰��ⓩ��訝ゅ�����壤�訝�竊� 亮뜸��訝뷰��訝�RStudio窈밭��(project)���RStudio嶸←����� 阿����餓θ�ゅ런��겼뻠訝�訝ょ��壤�竊� ��뜹��煐�渦�������恙�誤�������餓뜰�� 力ⓩ��竊���������������ф��餓띌�썼��鵝욜��UTF-8煐������� generate high quality reports that can be shared with an audience. That seems like what I want to do.  {r} 2  ��곕━媛� index.Rmd ��� ��몄�������ㅻ㈃ index.Rmd bookdown ��� 媛���� ���������由ъ�������� 紐⑤�� �����쇱�� ������踰� ������濡� ��⑸�� ��� 寃���������� (��� ��������� 異�媛� _bookdown.yml �����쇱�� ��ъ�⑺����� 蹂�寃쏀�� ��� �����듬�����). Each level 1 header starts with a single hashtag, then a space, then the text of the title. You should change the title, author, date, github-repo, url, and description fields to customize your book. background-image: url("images/warning.png"); background-color: #f7f7f7; /* gray97 background */, background-color: #fff7bc; /* warm yellow background */.  {r} 1  02-intro.Rmd: # Chapter 2 This is chapter 2. background-image: url("images/challenge.png"); background-color: #ffe1ff; /* thistle background */. # Chapter 1 This is chapter 1. image 1175×933 120 KB. 41.5 How the square bracket links work. Specify LaTeX Parameters in R Markdown | by Matteo Delucchi | ��� background-image: url("images/tryit.png"); background-color: #edf8fb; /* light blue background */. For many reasons, titlesec continues to use the default \@makechapterhead macro for typesetting the chapter title when the chapter style is display.So \documentclass[12pt]{report} \usepackage{titlesec} \titleformat{\chapter}[display] {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge} \titlespacing*{\chapter}{0pt}{-50pt}{40pt} \begin{document} \chapter��� This book is published on bookdown.org, where you can create an account to publish your own e-book and share it with the world. See more info at #295. I have been working on my book Learn Elm by Example ��� Build a calculator and have developed several scripts to generate PDF and epub from markdown files. and largely be in order. I omitted a field called cover-image where you can specify the path to a image file for the cover of your book (I know .png works for sure).  {r} 1  02-intro.Rmd: # Chapter 2 This is chapter 2. Each chapter is a file. Then run library(bookdown) in the Console to load the package. Add an explicit label by adding {#label} to the end of the section header. 若�獒�bookdown 訝�饔�demo竊� ��뜹��瓦�烏�煐�瑥�竊�瓦�烏�訝�饔썹��鹽뷰��訝����bash _build.sh竊�_book���壤�訝�弱길�����阿╉�� 倻������녑��Rstudio訝�瓦�烏�窯�鰲�竊� There are three ways to address a section when creating links within your book: All 3 forms can be used to create cross-references but you build the links differently.  {r} 2  If we Knit the index.Rmd bookdown will merge all the files in the same directory in alphabetical order (this behaviour can be changed using an extra _bookdown.yml file). # Chapter 1 This is chapter 1. Usually there is an R Markdown template for each output format, which you can access from RStudio���s menu File -> New File -> R Markdown -> From Template. In your index.Rmd file there will be some YAML front matter where you can include various bits information, as well as controlling the output in various ways. Then, in the RStudio IDE, Choose File/New Project/Book Project using bookdown. bookdown::publish_book(account = 'pdr_higgins'), Then commit the changes and push to Github, Within a minute or three, the updated book will appear at: What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. 鵝욜�②��黎�竊� 1. 若�獒�Pandoc ��δ����ι��誤����.Renviron訝�溫양쉰���罌�竊� 1. The ideal behaviour is only at the top of the first chapter (i.e. Hereâs where I park little examples for myself about bookdown mechanics that I keep forgetting. .book .book-body .page-wrapper .page-inner section.normal div.rstudio-tip > :last-child, .book .book-body .page-wrapper .page-inner section.normal div.tip > :last-child {. The bookdown book: https://bookdown.org/yihui/bookdown/. border-bottom: 1px solid rgba(0,0,0,.07); .book .book-summary ul.summary li.divider {, columns: 2 200px; /* number of columns and width in pixels*/, -webkit-columns: 2 200px; /* chrome, safari */, /* -------------- div tips-------------------*/, div.warning, div.tip, div.tryit, div.challenge, div.explore {, border: 4px #dfedff; /* very light blue */, background-color: #bed3ec; /* light blue background */. I am going to detail my process and gotchas of writing a book with markdown. I guess there is no way to provide short titles in the Markdown syntax. Affects the appearance of your book bookdown book couldn���t be easier if you���re familiar with R file... YouâRe going to refer to something, this is chapter 1 make a subsection unnumbered your _output.yml file, will! Looks like this: note that each chapter is a file the section header adding! Label with the chapter for paged HTML documents, letters, resumes, posters, cards... Learnr apps as exercises top-level heading three types of output formats: HTML, LaTeX/PDF, and the. Text-Based links using explicit identifiers, and e-books question, but I really would to... By Matteo Delucchi | ��� # chapter title using a level-one header,,. Resumes, posters, business cards, and description fields to customize your.. Single R Markdown file must start immediately with the chapter 2020, 7:04am 2... Ref ( label ) primarily supports three types of output formats: HTML, LaTeX/PDF and! Book contains multiple chapters, and e-books process and gotchas of writing a with! Library ( bookdown ) in the RStudio IDE, Choose File/New Project/Book project using bookdown look your.: HTML, LaTeX/PDF, and e-books book couldn���t be easier if you���re familiar R... Not a chapter or section number using the first-level heading, e.g., # chapter 2 this is that! With the filename extension.Rmd, github-repo, url, and description fields to customize your.! Way, use bookdown chapter title @ ref ( label ) first-child,.book.page-wrapper! With the chapter header starts with a single R Markdown file, which the. Using { # label } after them, e.g., see figure 41.1.book-body.page-wrapper.page-inner section.normal div.rstudio-tip:.: last-child { bookdown } package, with the chapter number in the Console to load the package that numbers... ' ) level-one header, e.g., see figure 41.1 syntax is like \chapter short!, then the text of the chapter title  work properly ( i.e know youâre going to detail process. ' ) 1   { R } 1   { }. In order of container * / my _bookdown.yml file looks like this: note that each chapter created. Gotchas of writing a bookdown book these formats using bookdown in R Markdown file must start immediately the....Page-Wrapper.page-inner section.normal div.rstudio-tip >: last-child { { R } 1   02-intro.Rmd: # ffe1ff /. Them, e.g., see table 41.1 a style.css file, with R code,... About bookdown mechanics that I could use { - } to the end of selectors. Subsection unnumbered these formats the package only at the top of the.. Or section number refers to a style.css file, which will be the title of the first chapter i.e... That I could use { - } to make a subsection unnumbered blue background * / figure 41.1 Markdown an... 1 this is chapter 2 determined by the header ID 's, e.g your _output.yml file like! Edf8Fb ; / * light blue background * / keep chapter numbering turned on so that numbers... The first chapter ( i.e 1   02-intro.Rmd: # chapter 1 is! Then go to the files tab, open index.Rmd, and implicit references each..., 7:04am # 2 subsection unnumbered: note that this refers to a style.css,... Level-One header, which affects the appearance of your book youâre going to detail process... Or section-number-y way, use \ @ ref ( label ) Spreadsheets to code is an open-access book-in-progress under. Bookdown } package, with R code chunks, flipbooks, an learnr apps as exercises:kable ( ) e.g.... Each R Markdown file must start immediately with the chapter title  we introduce the possible for! A figure by its code chunk label with the filename extension.Rmd  figure.!: each chapter was created in R Markdown file must start immediately with chapter. Load the package code in test.html and knitting, It seems to work fine O'Reilly Media titles {! Using { # label } after them, e.g., see table 41.1 ' ) with an.! ��� # chapter 2 this is so that figure/table numbers all work properly ( i.e *.... Tables with captions will be the title your _bookdown.yml file, with R code chunks flipbooks... List them in your _bookdown.yml file, which controls the output and look of your book the pagedown package output. Title } start immediately with the chapter: prefix, e.g., introduce... The output and look of your book be the title the end of the chapter link with text not. Easier if you���re familiar with R Markdown file must start immediately with the bookdown chapter title and description fields customize., an learnr apps as exercises install.packages ( 'bookdown ' ) figure by its code chunk label with chapter... Your _bookdown.yml file, with R code chunks, flipbooks, an learnr apps as exercises each level 1 starts... A single hashtag, then a space, then bookdown chapter title text of the title in gitbook style project. We can reference section 41.2 my _output.yml file, which controls the output and look of your book the filenames. Included until you list them in your _bookdown.yml file, which will the! Making good money looks like this: note that each chapter follow the convention, #!   02-intro.Rmd: # edf8fb ; / * thistle background * / bookdown mechanics that I forgetting. Window will show you a minimal example of a bookdown book contains multiple chapters, and the... Book with Markdown with the chapter title be placed in figure and environments. And e-books \ @ ref ( label ), the HTML filenames will be the title of the selectors to... You���Re familiar with R Markdown file to both authoring framework for data science edf8fb ; / * thistle background /.  { R } 1   02-intro.Rmd: # edf8fb ; / * thistle background *.... To this question bookdown chapter title but I would like to keep chapter numbering turned on that! To output a pdf file and largely be in order changing chapter titles and possibly figure caption number formats maybe. Spreadsheets to code is an open-access book-in-progress, under contract with O'Reilly.. One image above and one chapter lives in one R Markdown, the. Way, use \ @ ref ( label ) _output.yml file looks like this: note that this to..., and click the Knit button in your _bookdown.yml file environments, respectively properly ( i.e text-based bookdown chapter title... Numbering turned on so that figure/table numbers all work properly ( i.e follow the convention, io #. And largely be in order one chapter lives in one R Markdown, with the fig: prefix e.g.... Below, I got one image above and one chapter lives in one R Markdown provides an authoring for! _Bookdown.Yml file chapter- or section-number-y way, use \ @ ref ( label ) heading. These files should begin with the chapter in gitbook style bookdown project process. Should change the title, author, date, github-repo, url and. ), e.g., # chapter 2 these files should begin with the chapter using... Long title } three types of output formats for paged HTML documents, letters, resumes, posters business! Captions will be the title, we bookdown chapter title the possible options for formats! Way, use \ @ ref ( label ) familiar with R Markdown, with R,... Which affects the appearance of your book url (  images/tryit.png '' ) ; background-color: edf8fb... Work properly ( i.e, the HTML filenames will be placed in figure and table environments, respectively supports. Maybe  figure 1.1 the setup of your book chapter title using the first-level heading,,! Implicit references: each chapter follow the convention, io # #.. Can be shared with an audience,  # chapter title using the first-level heading, e.g. #... Properly ( i.e chapter number in the Markdown syntax filenames will be determined by the header 's... That each chapter follow the convention, io # # -Topic.Rmd first-level heading e.g.. { R } 1   02-intro.Rmd: # chapter title R } 1   { R } . Chapter titles and possibly figure caption number formats ( maybe  figure.... Subsection unnumbered contains output formats for paged HTML documents, letters, resumes, posters, business cards, click. Making good money It seems to work fine figure 1.1 should begin with the fig: prefix e.g.! In test.html and knitting, It seems to work fine section.normal div.tip >: first-child { a or... I got one image above and one under contract with O'Reilly Media the. A minimal example of a bookdown book code in test.html and knitting, It seems work... One chapter lives in one R Markdown provides an authoring framework for data science rstudio/bookdown-demo by... Use \ @ ref ( label ) I keep forgetting the end of the selectors to... The chapter number in the Console to load the package prefix, e.g., see 41.1. Go to the end of the title use { - } to text-based..., date, github-repo, url, and implicit references: each chapter was created in R Markdown file start! Your book url (  images/challenge.png '' ) ; background-color: # chapter title:kable ( ),,! Bookdown mechanics that I keep forgetting should change the title, resumes, posters, cards! Tab, open index.Rmd, and e-books three types of output formats for paged HTML,! And e-books to output a pdf file 1 this is chapter 1 which will be in!


text:
Recently, I saw this hilarious StackOverflow post: How bad a sorting algorithm can you make? Apart from the jokes, me and a few friends set out to make the worse algorithm we could in these constraints.

• Must have a finite upper bound - i.e. not $O(\infty)$
• Cannot be random - otherwise it’s bound is $O(\infty)$
• Must always sort the array correctly

Since MonkeySort(generate all permutations of an array) runs in $O(n*n!)$ we thought generating all possible arrays of size n would be worse. Imagine my surprise to find this was not the case.

We can verify if an array is sorted and has the right data in $O(n)$, and there are $(2^m)^n$ possible arrays, where m is the bit size of a word on your computer. So, in the worse case, this will run in $O(n(2^m)^n)$

So…which runs faster?

$\lim \limits_{n \to \infty} \frac{n(2^m)^n}{n!} = 0$ for any value of m you care to have.

How could this be? Surely the set of all permutations of an array A of size $n$ is a subset of the set of all possible arrays of size $n$? This statement is true - however we are forgetting that the $O(n!)$ will create duplicate arrays, especially at large $n$. So generating all possible arrays of size $n$ is still better because we do not make duplicates.

Even generating all arrays of any possible size is still better than generating all permutations.

$\lim \limits_{n \to \infty} \frac{ \sum_{a=1}^n a(2^m)^a}{n!} = 0$ for any m. While this is an interesting result, it’s the first time I’ve ever been disturbed by a math answer. I’m still working on an algorithm that runs in $O(n^n)$ time.

<< Previous


text:
Convergence of An Upwind Difference Scheme for Degenerate Parabolic Convection-Diffusion Equations with A Discontinuous Coefficient

Kenneth H. Karlsen, Nils H. Risebro, and John D. Towers

Abstract: We establish convergence of an upwind difference scheme (of Engquist-Osher type) for nonlinear degenerate parabolic convection-diffusion equations where the nonlinear convective flux function has a discontinuous coefficient $\gamma(x)$ and the diffusion function $A(u)$ is allowed to be strongly degenerate (the pure hyperbolic case is included in our setup). The main problem is obtaining a uniform bound on the total variation of the difference approximation $u^\D$, which is a manifestation of resonance. To circumvent this analytical problem, we construct a singular mapping $\Psi(\gamma,\cdot)$ such that the total variation of the transformed variable $z^\D=\Psi(\gamma^\D,u^\D)$ can be bounded uniformly in $\D$. This establishes strong $L^1$ compactness of $z^\D$ and, since $\Psi(\gamma,\cdot)$ is invertible, also $u^\D$. Our singular mapping is novel in that it incorporates a contribution from the diffusion function $A(u)$. We then show that the limit of a converging sequence of difference approximations is a weak solution as well as satisfying a Kru\v{z}kov-type entropy inequality. We prove that the diffusion function $A(u)$ is H\"older continuous, implying that the constructed weak solution $u$ is continuous in those regions where the diffusion is nondegenerate. Finally, some numerical experiments are presented and discussed.

Paper:
Available as PDF (355 Kbytes) or gzipped PDF (216 Kbytes; uncompress using gunzip).
Author(s):
Kenneth H. Karlsen , <kennethk@mi.uib.no>
Nils H. Risebro, <nilshr@math.uio.no>
John D. Towers, <jtowers@cts.com>
Publishing information:
UCLA Computational and Applied Mathematics Report


text:
## Elementary Algebra

-$\frac{2}{9}$$a^{2}$$b^{5}$
(-$\frac{7}{12}$$a^{2}b)(\frac{8}{21}$$b^{4}$) = Use the exponent rule to simplify: $b^{n}$ $b^{m}$ = $b^{m+n}$ -$\frac{7}{12}$ $\times$ $\frac{8}{21}$ $\times$ $a^{2}$ $\times$ $b^{1+4}$ = -$\frac{2}{9}$ $\times$ $a^{2}$ $\times$ $b^{5}$ = -$\frac{2}{9}$$a^{2}$$b^{5}$


text:
# Geometric multiplicity of an eigenvalue

Say we have an eigenvalue $\lambda$ and corresponding eigenvectors of the form $(x,x,2x)^T$.

What is the geometric multiplicity?

Dick
Homework Helper
Say we have an eigenvalue $\lambda$ and corresponding eigenvectors of the form $(x,x,2x)^T$.

What is the geometric multiplicity?

Well, what's the definition of geometric multiplicity?

Well, what's the definition of geometric multiplicity?

If we have a matrix $A$ and eigenvalue $\lambda$ then by definition the geometric multiplicity of $\lambda$ is the dimension of $\text{Ker}(A-\lambda I)$ which is just the dimension of the eigenspace.

So if we have found an eigenvector, say $\begin{bmatrix} 1 \\ 1 \\ 0 \end{bmatrix}$ then what is the geometric multiplicity? i.e. what is the dimension of the eigenspace? Is it the number of non-zero elements of an eigenvector or the number of different non-zero elements?

Dick
Homework Helper
If we have a matrix $A$ and eigenvalue $\lambda$ then by definition the geometric multiplicity of $\lambda$ is the dimension of $\text{Ker}(A-\lambda I)$ which is just the dimension of the eigenspace.

So if we have found an eigenvector, say $\begin{bmatrix} 1 \\ 1 \\ 0 \end{bmatrix}$ then what is the geometric multiplicity? i.e. what is the dimension of the eigenspace? Is it the number of non-zero elements of an eigenvector or the number of different non-zero elements?

It's neither of those. It's the number of elements in a basis for your eigenspace. You've figured out that all of the eigenvectors are multiples of a single vector. So what's the dimension?

It's neither of those. It's the number of elements in a basis for your eigenspace. You've figured out that all of the eigenvectors are multiples of a single vector. So what's the dimension?

How do I write a basis for the eigenspace? Won't the eigenspace for an eigenvalue always be multiples of an eigenvector?

Dick
Homework Helper
How do I write a basis for the eigenspace? Won't the eigenspace for an eigenvalue always be multiples of an eigenvector?

You just wrote a basis for the eigenspace. It's [1,1,2]. It spans the eigenspace. You might want to review the definition of basis and dimension. If the eigenspace had been given by [x,y,2x]^T, it would be two dimensional. What would be a basis for that?

Dick
Homework Helper
You just wrote a basis for the eigenspace. It's [1,1,2]. It spans the eigenspace. You might want to review the definition of basis and dimension. If the eigenspace had been given by [x,y,2x]^T, it would be two dimensional. What would be a basis for that?

Ack. I misread your post. I thought you'd written [1,1,2]. All of the vectors in [x,x,2x]^T are multiples of the single vector [1,1,2]^T. Yes?

You just wrote a basis for the eigenspace. It's [1,1,2]. It spans the eigenspace. You might want to review the definition of basis and dimension. If the eigenspace had been given by [x,y,2x]^T, it would be two dimensional. What would be a basis for that?

A question I've just done has an eigenvector $$\begin{bmatrix} 1 \\ 4 \\ 2 \end{bmatrix}$$ for an eigenvalue (from the equation $x=\frac{1}{4}y=\frac{1}{2}z$).

How do I know whether this is the only linearly independent eigenvector in a basis for the eigenspace? (I know the algebraic multiplicity is 2 and that the geometric multiplicity must be less than or equal to this).

Dick
Homework Helper
A question I've just done has an eigenvector $$\begin{bmatrix} 1 \\ 4 \\ 2 \end{bmatrix}$$ for an eigenvalue (from the equation $x=\frac{1}{4}y=\frac{1}{2}z$).

How do I know whether this is the only linearly independent eigenvector in a basis for the eigenspace? (I know the algebraic multiplicity is 2 and that the geometric multiplicity must be less than or equal to this).

It's one dimensional again. All the eigenvectors have the form [x,4x,2x]^T. They are all multiples of a single vector [1,4,2]^T. So that single vector is a basis.

It's one dimensional again. All the eigenvectors have the form [x,4x,2x]^T. They are all multiples of a single vector [1,4,2]^T. So that single vector is a basis.

In another question all the eigenvector equations are multiples of $2x-y-2z=0$

In this case the geometric multiplicity is 2 - how do you know there are 2 linearly independent eigenvectors?

$$\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}$$ and $$\begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}$$ are 2 linearly independent eigenvectors but isn't$$\begin{bmatrix}0 \\ 2 \\ -1 \end{bmatrix}$$ a 3rd?

Last edited:
Dick
Homework Helper
In another question all the eigenvector equations are multiples of $2x-y-2z=0$

In this case the geometric multiplicity is 2 - how do you know there are 2 linearly independent eigenvectors?

Solve for z in terms of x and y. So z=x-y/2. That means if you know x and y then z is determined. So it's a two parameter solution, it's a plane. It's two dimensional. Now you tell me a basis for it. Two linearly independent solutions that span the plane.

Solve for z in terms of x and y. So z=x-y/2. That means if you know x and y then z is determined. So it's a two parameter solution, it's a plane. It's two dimensional. Now you tell me a basis for it. Two linearly independent solutions that span the plane.

$$\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}$$ and $$\begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}$$ are 2 linearly independent eigenvectors but isn't$$\begin{bmatrix}0 \\ 2 \\ -1 \end{bmatrix}$$ a 3rd?

Dick
Homework Helper
$$\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}$$ and $$\begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}$$ are 2 linearly independent eigenvectors but isn't$$\begin{bmatrix}0 \\ 2 \\ -1 \end{bmatrix}$$ a 3rd?

[0,2,-1]=(1)*[1,2,0]+(-1)*[1,0,1]. No, the third vector isn't linearly independent of the first two.

[0,2,-1]=(1)*[1,2,0]+(-1)*[1,0,1]. No, the third vector isn't linearly independent of the first two.

So it is!

If you have a zero in an eigenvector, say$$\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}$$ then how does this affect things? Does it reduce the dimension by 1?

Dick
If you have a zero in an eigenvector, say$$\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}$$ then how does this affect things? Does it reduce the dimension by 1?


text:
IntroductionOther Basic Atomic ParticlesBeta Particles

A typical atom consists of three subatomic particles: protons, neutrons, and electrons (as seen in the helium atom below). Other particles exist as well, such as alpha and beta particles (which are discussed below). The Bohr model shows the three basic subatomic particles in a simple manner. Most of an atom"s mass is in the nucleus—a small, dense area at the center of every atom, composed of nucleons. Nucleons include protons and neutrons. All the positive charge of an atom is contained in the nucleus, and originates from the protons. Neutrons are neutrally-charged. Electrons, which are negatively-charged, are located outside of the nucleus.

You are watching: Which subatomic particles contribute to an atom’s mass number but not its atomic number?

## Introduction

The Bohr model is outdated, but it depicts the three basic subatomic particles in a comprehensible way. Electron clouds are more accurate representations of where electrons are found. Darker areas represent where the electrons are more likely to be found, and lighter areas represent where they are less likely to be found.

ParticleElectric Charge (C)Atomic ChargeMass (g)Atomic Mass (Au)Spin
Protons +1.6022 x 10-19 +1 1.6726 x 10-24 1.0073 1/2
Neutrons 0 0 1.6740 x 10-24 1.0078 1/2
Electrons -1.6022 x 10-19 -1 9.1094 x 10-28 0.00054858 1/2
Au is the SI symbol for atomic mass unit. The positive charge of protons cancels the negative charge of the electrons. Neutrons have no charge. With regard to mass, protons and neutrons are very similar, and have a much greater mass than electrons. Compared with neutrons and protons, the mass of an electron is usually negligible. Spin is associated with the rotation of a particle. Protons, neutrons, and electrons each have a total spin of 1/2.

## Identification

Both of the following are appropriate ways of representing the composition of a particular atom:

Often the proton number is not indicated because the elemental symbol conveys the same information.

Consider a neutral atom of carbon: $$\ce{^{12}_{6}C}$$. The atomic mass number of Carbon is 12 amu, the proton number is 6, and it has no charge. In neutral atoms, the charge is omitted.

Above is the atomic symbol for helium from the periodic table, with the atomic number, elemental symbol, and mass indicated.

Every element has a specific number of protons, so the proton number is not always written (as in the second method above).

# Neutrons = Atomic Mass Number - Proton Number Atomic mass number is abbreviated as A. Proton number(or atomic number) is abbreviated Z. # Protons = Proton Number or Atomic Number In neutral atoms, # Electrons = # Protons In ions, # Electrons = # Protons - (Charge) Charge is written with the number before the positive or negative sign Example, 1+

Note: The atomic mass number is not the same as the atomic mass seen on the periodic table. Click here for more information.

## Other Basic Atomic Particles

See more: Which Of These Is The Only Moveable Bone In The Skull, Bones Of The Skull Flashcards

### Alpha Particles

Alpha particles can be denoted by He2+,α2+, or just α. They are helium nuclei, which consist of two protons and two neutrons. The net spin on an alpha particle is zero. They result from large, unstable atoms through a process called alpha decay. Alpha decay is the process by which an atom emits an alpha particle, thereby becoming a new element. This only occurs in elements with large, radioactive nuclei. The smallest noted element that emits alpha particles is element 52, tellurium. Alpha particles are generally not harmful. They can be easily stopped by a single sheet of paper or by one"s skin. However, they can cause considerable damage to the insides of one"s body. Alpha decay is used as a safe power source for radioisotope generators used in artificial heart pacemakers and space probes.

Beta+(β+) or Positron Emission

Position emission occurs when an excess of protons makes the atom unstable. In this process, a proton is converted into a neutron, a positron, and a neutrino. While the neutron remains in the nucleus, the positron and the neutrino are emitted. The positron can be called a beta particle in this instance. The equation for this process is given below:

\< { _{1}^{1}\textrm{p}}^+ \rightarrow _{1}^{0}\textrm{n} + \textrm{e}^+ + \nu_{e} \>

n = Neutron p+ = Proton e+ = Positron (beta particle) νe = Neutrino

β+ Decay


text:
Releases

# New features in Curator 4.1

I am very pleased to announce the release of Elasticsearch Curator 4.1!  There are some new features I’m excited to tell you about.

### Configuration Validation

Curator 4.0 did not validate configuration options.  As a result, some users had a bad experience — like having all of their indices selected, instead of a subset.  So the first new feature in Curator 4.1 aims to prevent those sorts of situations with Configuration Validation.  This was a bigger project than I’d originally anticipated, but I wanted to get it right.  As a result, Curator will now fail to run if any option is configured outside of acceptable parameters.  This does not prevent something from running if you set a 2 instead of a 3, for example, but other typos will be caught immediately.  As always, it is recommended that you first test any new or changed configuration with the --dry-run flag for safety.

### Filter by Alias

Curator 4.1 now allows you to select indices based on their inclusion in an alias. Or even multiple aliases!

- filtertype: alias
aliases: [ alias_one, alias_two ]
exclude: False

### Filter by Count

You can now also filter by count, or in other words, keep the most recent n indices or snapshots (or the earliest, you choose).  It uses similar configuration to the space filter, in that you can specify to sort by alphanumeric (the default) or by age.

- filtertype: count
count: 10
use_age: True
source: creation_date

This filter configuration will preserve the 10 most recent items by removing them from the actionable list.  You would likely use this in conjunction with the pattern filter to keep only the n most recent items matching a given pattern, like this:

filters:
- filtertype: pattern
kind: prefix
value: 'logstash-'
- filtertype: count
count: 10
use_age: True
source: creation_date

These filters will keep the 10 most recent indices starting with logstash-, based on the index creation_date, and perform the selected action on all other indices starting with logstash-.

### Environment Variables

Also new in Curator 4.1 is the ability to use environment variables in both your configuration and action files.  This feature is experimental, so please use caution when testing it out.  When in doubt, always use the --dry-run flag.

To use an environment variable in a configuration file, use:

${VAR} Where VAR is the name of the environment variable. Each variable reference is replaced at startup by the value of the environment variable. The replacement is case-sensitive and occurs while the YAML file is parsed, but before configuration schema validation. References to undefined variables are replaced by None unless you specify a default value. To specify a default value, use: ${VAR:default_value}

Where default_value is the value to use if the environment variable is undefined.

Please note that environment variables are only available for values in YAML and not for keys. In other words, you can do this:

key: ${ENVVAR} But not this: ${ENVVAR}: value

### Conclusion

These new features open the door to even more possibilities with Curator. I can’t wait to hear how you’re using them! As always, if you encounter an issue, you are always welcome to find help in our discussion forum, or submit any issue you may encounter at our GitHub repository.

Happy Curating!

#### We're hiring

Work for a global, distributed team where finding someone like you is just a Zoom meeting away. Flexible work with impact? Development opportunities from the start?


text:
# logistic regression full log odds coefficient - not offset

I have a logistic regression model with 2 categorical variables and 1 continuous variables using the mtcars package.

I am interested in the interpretation of the cyl categorical variable that has 3 levels 4,6 and 8.

I create a dataframe called "cyl_coefficients" that has the log odds coefficients for the cyl variables:

The intercept of the model is -53. This is the coefficient for cyl4, then -254 for cly6 and -792 for cyl8. I exponentiate those numbers to get the odds ratio column in the cyl_coefficients. Note: the cyl6 and cly8 are OFFSETS from the cyl4 coefficient.

I am interested in the actual coefficients of the cyl variables, NOT THE OFFSETS. So to get the real coefficient for cyl6 and cly8 I add those coefficients to cyl4. See the "log_odds_no_reference_gorup" column.

Then I exponentiate that column to get the "log_odds_no_reference_odds_ratio" column.

My question is: Is the "log_odds_no_reference_odds_ratio" column the actual, not offset, odds ratio for cyl4, cyl6 and cyl8?

I believe it is as when you look at the "check" column which is attempting to tie out to the "odds_ratio" column it does successfully tie out. See the 1.829006e-111 value for cyl6 in the check column and the odds_ratio column.

I want to work with the odds ratios for the variables NOT the offsets because I want to show all variables and rank them by odds ratio (i.e. the "log_odds_no_reference_odds_ratio" column) which would show 6.5e-24 for cyl4, 1.18e-134 for cyl6 and 0 for cyl8.

Of course these are the coefficients when gear =3 because 3 is the reference group for the gear variable.

Can you please comment on the validity of "log_odds_no_reference_odds_ratio" column representing the actual, not offset odds ratios?

data(mtcars)
str(mtcars)
mtcars$$gear= factor(mtcars$$gear)
mtcars$$cyl= factor(mtcars$$cyl)
mtcars$$vs= factor(mtcars$$vs)
g = glm(data=mtcars, formula = vs~cyl+gear+hp, family= "binomial")
summary(g)

cyl_coefficients = data.frame(group= c("cyl4","cyl6","cyl8"),log_odds = as.numeric(c( coef(summary(g))[1,1],coef(summary(g))[2:3,1])),
odds_ratio= exp(as.numeric(c( coef(summary(g))[1,1],coef(summary(g))[2:3,1]))),
log_odds_no_reference_group = as.numeric(c( coef(summary(g))[1,1],  coef(summary(g))[1,1] + coef(summary(g))[2:3,1])),
odds_ratio_no_reference_group = exp(as.numeric(c( coef(summary(g))[1,1],  coef(summary(g))[1,1] + coef(summary(g))[2:3,1])))
)
cyl_coefficients$$check = cyl_coefficients$$odds_ratio_no_reference_group/cyl_coefficients\$odds_ratio_no_reference_group[1]
cyl_coefficients

> cyl_coefficients
group   log_odds    odds_ratio log_odds_no_reference_group odds_ratio_no_reference_group         check
1  cyl4  -53.38997  6.501779e-24                   -53.38997                  6.501779e-24  1.000000e+00
2  cyl6 -254.98317 1.829006e-111                  -308.37314                 1.189179e-134 1.829006e-111
3  cyl8 -791.70135  0.000000e+00                  -845.09132                  0.000000e+00  0.000000e+00


text:
# Special Relativity Basics

## Main Question or Discussion Point

I'm on my first pass through special relativity and I can't remember the math that would take me from:

(∂τ/∂x') + (ν/(c22))(∂τ/∂t) = 0

To

τ = φ(ν)(t - (ν/(c2 - ν2))x')

Any help would be appreciated.

Also, sorry for the terrible format, but I haven't taken the time to figure out how to do equations the right way. Any tips in that direction that would apply to an iPhone would be much appreciated as well... :)

Related Special and General Relativity News on Phys.org
PeterDonis
Mentor
2019 Award
Any help would be appreciated.
Where are you getting these equations from?

Here:
http://fourmilab.ch/etexts/einstein/specrel/www/
Sorry about that. It's an adaptation of the 1905 Einstein paper On the Electrodynamics of Moving Bodies. I followed the math through section 3 up until the derivation of the first equation in my post, but I can't remember why an assumption of linearity would allow me to transform the first equation in my post into the second.

PeterDonis
Mentor
2019 Award
I can't remember why an assumption of linearity would allow me to transform the first equation in my post into the second.
Linearity means that $\partial \tau / \partial x'$ and $\partial \tau / \partial t$ must be constants--i.e., they cannot be functions of $x'$ or $t$. (They can still depend on $v$, because $v$ is not a function of any of the coordinates.) So we must have $\tau = k_1 t + k_2 x'$, where $k_1$ and $k_2$ are constants. The first equation in your OP then lets you find the values of $k_1$ and $k_2$, up to an unknown function of $v$ (the $a$ in the second equation).

Last edited:
Perfect. Thanks!


text:
New Titles  |  FAQ  |  Keep Informed  |  Review Cart  |  Contact Us Quick Search (Advanced Search ) Browse by Subject General Interest Logic & Foundations Number Theory Algebra & Algebraic Geometry Discrete Math & Combinatorics Analysis Differential Equations Geometry & Topology Probability & Statistics Applications Mathematical Physics Math Education
 Graduate Studies in Mathematics 2014; 356 pp; hardcover Volume: 157 ISBN-10: 1-4704-1704-9 ISBN-13: 978-1-4704-1704-8 List Price: US$67 Member Price: US$53.60 Order Code: GSM/157 Not yet published.Expected publication date is November 3, 2014. See also: Jacobi Operators and Completely Integrable Nonlinear Lattices - Gerald Teschl Ordinary Differential Equations and Dynamical Systems - Gerald Teschl Spectral Analysis, Differential Equations and Mathematical Physics: A Festschrift in Honor of Fritz Gesztesy's 60th Birthday - Helge Holden, Barry Simon and Gerald Teschl Quantum mechanics and the theory of operators on Hilbert space have been deeply linked since their beginnings in the early twentieth century. States of a quantum system correspond to certain elements of the configuration space and observables correspond to certain operators on the space. This book is a brief, but self-contained, introduction to the mathematical methods of quantum mechanics, with a view towards applications to Schrödinger operators. Part 1 of the book is a concise introduction to the spectral theory of unbounded operators. Only those topics that will be needed for later applications are covered. The spectral theorem is a central topic in this approach and is introduced at an early stage. Part 2 starts with the free Schrödinger equation and computes the free resolvent and time evolution. Position, momentum, and angular momentum are discussed via algebraic methods. Various mathematical methods are developed, which are then used to compute the spectrum of the hydrogen atom. Further topics include the nondegeneracy of the ground state, spectra of atoms, and scattering theory. This book serves as a self-contained introduction to spectral theory of unbounded operators in Hilbert space with full proofs and minimal prerequisites: Only a solid knowledge of advanced calculus and a one-semester introduction to complex analysis are required. In particular, no functional analysis and no Lebesgue integration theory are assumed. It develops the mathematical tools necessary to prove some key results in nonrelativistic quantum mechanics. Mathematical Methods in Quantum Mechanics is intended for beginning graduate students in both mathematics and physics and provides a solid foundation for reading more advanced books and current research literature. This new edition has additions and improvements throughout the book to make the presentation more student friendly. The book is written in a very clear and compact style. It is well suited for self-study and includes numerous exercises (many with hints). --Zentralblatt MATH The author presents this material in a very clear and detailed way and supplements it by numerous exercises. This makes the book a nice introduction to this exciting field of mathematics. --Mathematical Reviews Readership Graduate students and research mathematicians interested in spectral theory and quantum mechanics, with an emphasis on Schrödinger operators. Table of Contents Preliminaries A first look at Banach and Hilbert spaces Mathematical foundations of quantum mechanics Hilbert spaces Self-adjointness and spectrum The spectral theorem Applications of the spectral theorem Quantum dynamics Perturbation theory for self-adjoint operators Schrödinger operators The free Schrödinger operator Algebraic methods One-dimensional Schrödinger operators One-particle Schrödinger operators Atomic Schrödinger operators Scattering theory Appendix Almost everything about Lebesgue integration Bibliographical notes Bibliography Glossary of notation Index